@ai-matrx/sharing 0.1.0 → 0.1.2

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.
@@ -370,7 +370,7 @@ function LevelChoice({
370
370
  "aria-pressed": active,
371
371
  onClick,
372
372
  className: [
373
- "rounded-full border px-3 py-1 text-xs font-medium transition-colors",
373
+ "whitespace-nowrap rounded-full border px-3 py-1 text-xs font-medium transition-colors",
374
374
  active ? "border-primary bg-primary/10 text-primary-ink" : "border-border bg-background text-muted-foreground hover:bg-accent"
375
375
  ].join(" "),
376
376
  children: label
@@ -2366,8 +2366,8 @@ import {
2366
2366
  Send as Send5,
2367
2367
  Undo2 as Undo22
2368
2368
  } from "lucide-react";
2369
- import { Badge, Skeleton, cn as cn3 } from "@ai-matrx/design-system";
2370
- import { Button as Button14 } from "@ai-matrx/design-system/controls";
2369
+ import { Skeleton, cn as cn3 } from "@ai-matrx/design-system";
2370
+ import { Button as Button14, SegmentedControl } from "@ai-matrx/design-system/controls";
2371
2371
  import { RefreshCwTapButton } from "@ai-matrx/design-system/tap-target/buttons";
2372
2372
  import { formatRelativeTime } from "@ai-matrx/kit/format";
2373
2373
  import {
@@ -2468,8 +2468,6 @@ function EmptyState({ box }) {
2468
2468
  function AccessRequestsSurface() {
2469
2469
  const ui = useAccessUi();
2470
2470
  const { toast, confirm } = ui;
2471
- const NAV_ITEM_SELECTED = ui.navItemClasses.selected;
2472
- const NAV_ITEM_UNSELECTED = ui.navItemClasses.unselected;
2473
2471
  const [box, setBox] = useState16(() => boxFromParam(ui.searchParam("box")));
2474
2472
  const currentUserId = ui.useCurrentUser().id;
2475
2473
  const [rows, setRows] = useState16({
@@ -2577,24 +2575,10 @@ function AccessRequestsSurface() {
2577
2575
  "Request withdrawn."
2578
2576
  );
2579
2577
  }
2580
- const tab = (target, label, count) => /* @__PURE__ */ jsxs15(
2581
- "button",
2582
- {
2583
- type: "button",
2584
- onClick: () => setBox(target),
2585
- "aria-current": box === target ? "page" : void 0,
2586
- className: cn3(
2587
- "inline-flex items-center gap-1.5 whitespace-nowrap rounded-full px-3 py-1 text-xs transition-colors",
2588
- box === target ? NAV_ITEM_SELECTED : NAV_ITEM_UNSELECTED
2589
- ),
2590
- children: [
2591
- target === "inbox" ? /* @__PURE__ */ jsx17(Inbox, { className: "h-3.5 w-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx17(Send5, { className: "h-3.5 w-3.5", "aria-hidden": true }),
2592
- label,
2593
- count > 0 && /* @__PURE__ */ jsx17(Badge, { className: "pointer-events-none h-4 min-w-[16px] border-0 bg-primary px-1 text-[9px] font-semibold text-primary-foreground hover:bg-primary", children: count > 99 ? "99+" : count })
2594
- ]
2595
- },
2596
- target
2597
- );
2578
+ const tabLabel = (target, label) => /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1.5", children: [
2579
+ target === "inbox" ? /* @__PURE__ */ jsx17(Inbox, { className: "h-3.5 w-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx17(Send5, { className: "h-3.5 w-3.5", "aria-hidden": true }),
2580
+ label
2581
+ ] });
2598
2582
  return /* @__PURE__ */ jsxs15("div", { className: "mx-auto w-full max-w-3xl", children: [
2599
2583
  /* @__PURE__ */ jsxs15("div", { className: "mb-3 flex items-center justify-between gap-2", children: [
2600
2584
  /* @__PURE__ */ jsxs15("span", { className: "hidden items-center gap-1.5 text-sm font-medium sm:inline-flex", children: [
@@ -2602,10 +2586,18 @@ function AccessRequestsSurface() {
2602
2586
  "Access requests"
2603
2587
  ] }),
2604
2588
  /* @__PURE__ */ jsxs15("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
2605
- /* @__PURE__ */ jsxs15("div", { className: "matrx-glass-thin-border inline-flex items-center gap-1 rounded-full p-1", children: [
2606
- tab("inbox", "To me", inboxCount),
2607
- tab("sent", "I sent", sentPending)
2608
- ] }),
2589
+ /* @__PURE__ */ jsx17(
2590
+ SegmentedControl,
2591
+ {
2592
+ "aria-label": "Request box",
2593
+ value: box,
2594
+ onValueChange: setBox,
2595
+ data: [
2596
+ { value: "inbox", label: tabLabel("inbox", "To me"), count: inboxCount > 0 ? inboxCount : null },
2597
+ { value: "sent", label: tabLabel("sent", "I sent"), count: sentPending > 0 ? sentPending : null }
2598
+ ]
2599
+ }
2600
+ ),
2609
2601
  /* @__PURE__ */ jsx17(
2610
2602
  RefreshCwTapButton,
2611
2603
  {