@flytedan/flytebot-design-system 0.87.4 → 0.87.6

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
@@ -647,11 +647,14 @@ declare function PhasedProgress({ phases, summary, className }: PhasedProgressPr
647
647
  interface ProgressBarProps {
648
648
  /** 0-100. Omit for indeterminate. */
649
649
  value?: number;
650
+ /** Shown above the bar, and the bar's accessible name. */
650
651
  label?: string;
652
+ /** The bar's accessible name when its surroundings already show what it measures, so no label is shown. */
653
+ "aria-label"?: string;
651
654
  showValue?: boolean;
652
655
  className?: string;
653
656
  }
654
- declare function ProgressBar({ value, label, showValue, className, ...rest }: ProgressBarProps): React.JSX.Element;
657
+ declare function ProgressBar({ value, label, "aria-label": ariaLabel, showValue, className, ...rest }: ProgressBarProps): React.JSX.Element;
655
658
 
656
659
  /**
657
660
  * A skeleton exactly as large as the content it stands in for. `children` is that content's own
package/dist/index.d.ts CHANGED
@@ -647,11 +647,14 @@ declare function PhasedProgress({ phases, summary, className }: PhasedProgressPr
647
647
  interface ProgressBarProps {
648
648
  /** 0-100. Omit for indeterminate. */
649
649
  value?: number;
650
+ /** Shown above the bar, and the bar's accessible name. */
650
651
  label?: string;
652
+ /** The bar's accessible name when its surroundings already show what it measures, so no label is shown. */
653
+ "aria-label"?: string;
651
654
  showValue?: boolean;
652
655
  className?: string;
653
656
  }
654
- declare function ProgressBar({ value, label, showValue, className, ...rest }: ProgressBarProps): React.JSX.Element;
657
+ declare function ProgressBar({ value, label, "aria-label": ariaLabel, showValue, className, ...rest }: ProgressBarProps): React.JSX.Element;
655
658
 
656
659
  /**
657
660
  * A skeleton exactly as large as the content it stands in for. `children` is that content's own
package/dist/index.js CHANGED
@@ -1602,7 +1602,7 @@ var JOBS_LAYER = ROOT_STEP - 1;
1602
1602
  var SLOTS = ["jobs", "toasts"];
1603
1603
  var references = /* @__PURE__ */ new Map();
1604
1604
  var host = null;
1605
- var hostObserver = null;
1605
+ var jobsObserver = null;
1606
1606
  var slotElements = /* @__PURE__ */ new Map();
1607
1607
  var SLOT_LAYERS = { jobs: JOBS_LAYER, toasts: OVERLAY_CEILING };
1608
1608
  function createHost() {
@@ -1620,8 +1620,8 @@ function createHost() {
1620
1620
  const jobs2 = slotElements.get("jobs");
1621
1621
  publishInset(jobs2);
1622
1622
  if (typeof ResizeObserver === "function") {
1623
- hostObserver = new ResizeObserver(() => publishInset(jobs2));
1624
- hostObserver.observe(jobs2);
1623
+ jobsObserver = new ResizeObserver(() => publishInset(jobs2));
1624
+ jobsObserver.observe(jobs2);
1625
1625
  }
1626
1626
  return stack;
1627
1627
  }
@@ -1640,8 +1640,8 @@ function release(slot) {
1640
1640
  if (remaining > 0) references.set(slot, remaining);
1641
1641
  else references.delete(slot);
1642
1642
  if (references.size === 0 && host) {
1643
- hostObserver?.disconnect();
1644
- hostObserver = null;
1643
+ jobsObserver?.disconnect();
1644
+ jobsObserver = null;
1645
1645
  document.documentElement.style.removeProperty(CORNER_STACK_INSET_PROPERTY);
1646
1646
  host.remove();
1647
1647
  host = null;
@@ -1691,7 +1691,14 @@ function useSheetOpenMark(active) {
1691
1691
 
1692
1692
  // src/components/loading/ProgressBar.tsx
1693
1693
  import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
1694
- function ProgressBar({ value, label, showValue = false, className = "", ...rest }) {
1694
+ function ProgressBar({
1695
+ value,
1696
+ label,
1697
+ "aria-label": ariaLabel = label,
1698
+ showValue = false,
1699
+ className = "",
1700
+ ...rest
1701
+ }) {
1695
1702
  const indeterminate = value === void 0 || value === null;
1696
1703
  const pct = indeterminate ? 0 : Math.max(0, Math.min(100, value));
1697
1704
  return /* @__PURE__ */ jsxs13("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 8 }, children: [
@@ -1710,7 +1717,7 @@ function ProgressBar({ value, label, showValue = false, className = "", ...rest
1710
1717
  "aria-valuenow": indeterminate ? void 0 : pct,
1711
1718
  "aria-valuemin": 0,
1712
1719
  "aria-valuemax": 100,
1713
- "aria-label": label,
1720
+ "aria-label": ariaLabel,
1714
1721
  ...rest,
1715
1722
  children: /* @__PURE__ */ jsx19("div", { className: "fd-progress-fill", style: indeterminate ? void 0 : { width: pct + "%" } })
1716
1723
  }
@@ -1769,7 +1776,7 @@ function JobCard({ job, onDismiss }) {
1769
1776
  ] }),
1770
1777
  job.note ? /* @__PURE__ */ jsx20("span", { className: "fd-job-card-note fd-secondary", children: job.note }) : null,
1771
1778
  job.status === "active" ? /* @__PURE__ */ jsxs14("div", { className: "fd-job-card-progress", children: [
1772
- /* @__PURE__ */ jsx20(ProgressBar, { value: job.progress, label: title }),
1779
+ /* @__PURE__ */ jsx20(ProgressBar, { value: job.progress, "aria-label": title }),
1773
1780
  job.progressNote ? /* @__PURE__ */ jsx20("span", { className: "fd-job-card-note fd-secondary", children: job.progressNote }) : null
1774
1781
  ] }) : null,
1775
1782
  job.status === "done" ? /* @__PURE__ */ jsxs14("div", { className: "fd-job-card-done", children: [
@@ -16273,9 +16280,10 @@ function useExportJobs({ list, acknowledge }) {
16273
16280
  const [rows, setRows] = React95.useState([]);
16274
16281
  const listRef = useLatest(list);
16275
16282
  const acknowledgeRef = useLatest(acknowledge);
16283
+ const dismissing = React95.useRef(/* @__PURE__ */ new Set());
16276
16284
  const reload = React95.useCallback(
16277
16285
  () => listRef.current().then(
16278
- (fresh) => setRows(fresh),
16286
+ (fresh) => setRows(fresh.filter((row) => !dismissing.current.has(row.id))),
16279
16287
  () => {
16280
16288
  }
16281
16289
  ),
@@ -16292,8 +16300,19 @@ function useExportJobs({ list, acknowledge }) {
16292
16300
  const refresh2 = React95.useCallback(() => void reload(), [reload]);
16293
16301
  const ackExport = React95.useCallback(
16294
16302
  (id) => {
16303
+ dismissing.current.add(id);
16295
16304
  setRows((current2) => current2.filter((row) => row.id !== id));
16296
- void acknowledgeRef.current(id).then(reload, reload);
16305
+ void acknowledgeRef.current(id).then(
16306
+ () => {
16307
+ dismissing.current.delete(id);
16308
+ return reload();
16309
+ },
16310
+ (error) => {
16311
+ dismissing.current.delete(id);
16312
+ console.error(`Dismissing export ${id} failed; it is back in the tray.`, error);
16313
+ return reload();
16314
+ }
16315
+ );
16297
16316
  },
16298
16317
  [acknowledgeRef, reload]
16299
16318
  );