@tutti-os/ui-system 0.0.124 → 0.0.125

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.
@@ -1475,6 +1475,9 @@ function Input({
1475
1475
  );
1476
1476
  }
1477
1477
 
1478
+ // src/components/mention-pill/mention-pill.tsx
1479
+ import * as React7 from "react";
1480
+
1478
1481
  // src/components/mention-pill/truncating-pill-label.tsx
1479
1482
  import * as React6 from "react";
1480
1483
 
@@ -1609,12 +1612,15 @@ function MentionPill({
1609
1612
  className,
1610
1613
  fileKind = "file",
1611
1614
  iconUrl,
1615
+ iconContainerProps,
1616
+ fallbackIconProps,
1612
1617
  kind,
1613
1618
  label,
1614
1619
  removable = kind === "file",
1615
1620
  removeButtonProps,
1616
1621
  style,
1617
1622
  summary,
1623
+ tooltipEnabled = true,
1618
1624
  withTooltipProvider = true,
1619
1625
  ...props
1620
1626
  }) {
@@ -1623,6 +1629,7 @@ function MentionPill({
1623
1629
  const color = isFile && fileKind === "folder" ? "var(--folder)" : mentionPillTokenByKind[kind];
1624
1630
  const dataKind = mentionPillDataKindByKind[kind];
1625
1631
  const normalizedIconUrl = iconUrl?.trim() ?? "";
1632
+ const [failedIconUrl, setFailedIconUrl] = React7.useState(null);
1626
1633
  const iconSizeClassName = "size-4";
1627
1634
  const iconShellClassName = isFile || kind === "session" ? "size-4" : "size-[18px]";
1628
1635
  const tooltipText = [label, summary].filter(
@@ -1648,35 +1655,44 @@ function MentionPill({
1648
1655
  /* @__PURE__ */ jsxs8(
1649
1656
  "span",
1650
1657
  {
1658
+ ...iconContainerProps,
1651
1659
  "aria-hidden": removable ? void 0 : true,
1652
1660
  className: cn(
1653
1661
  "relative grid shrink-0 place-items-center",
1654
- iconShellClassName
1662
+ iconShellClassName,
1663
+ iconContainerProps?.className
1655
1664
  ),
1656
1665
  children: [
1657
- normalizedIconUrl ? /* @__PURE__ */ jsx16(
1666
+ /* @__PURE__ */ jsx16(
1667
+ Icon,
1668
+ {
1669
+ ...fallbackIconProps,
1670
+ className: cn(
1671
+ "col-start-1 row-start-1 text-current transition-opacity",
1672
+ removable && "group-hover:opacity-0 group-focus-within:opacity-0",
1673
+ iconSizeClassName,
1674
+ fallbackIconProps?.className
1675
+ ),
1676
+ "data-mention-pill-fallback-icon": "true"
1677
+ }
1678
+ ),
1679
+ normalizedIconUrl && failedIconUrl !== normalizedIconUrl ? /* @__PURE__ */ jsx16(
1658
1680
  "img",
1659
1681
  {
1660
1682
  src: normalizedIconUrl,
1661
1683
  alt: "",
1662
1684
  className: cn(
1663
- "size-full rounded-[3px] object-cover transition-opacity",
1685
+ "col-start-1 row-start-1 size-full rounded-[3px] object-cover transition-opacity",
1664
1686
  removable && "group-hover:opacity-0 group-focus-within:opacity-0"
1665
1687
  ),
1666
1688
  decoding: "async",
1667
1689
  loading: "lazy",
1668
- draggable: false
1669
- }
1670
- ) : /* @__PURE__ */ jsx16(
1671
- Icon,
1672
- {
1673
- className: cn(
1674
- "text-current transition-opacity",
1675
- removable && "group-hover:opacity-0 group-focus-within:opacity-0",
1676
- iconSizeClassName
1677
- )
1690
+ draggable: false,
1691
+ onError: () => {
1692
+ setFailedIconUrl(normalizedIconUrl);
1693
+ }
1678
1694
  }
1679
- ),
1695
+ ) : null,
1680
1696
  removable ? /* @__PURE__ */ jsx16(
1681
1697
  "button",
1682
1698
  {
@@ -1696,7 +1712,7 @@ function MentionPill({
1696
1712
  /* @__PURE__ */ jsxs8(
1697
1713
  TruncatingPillLabel,
1698
1714
  {
1699
- tooltip: tooltipText,
1715
+ tooltip: tooltipEnabled ? tooltipText : "",
1700
1716
  withTooltipProvider,
1701
1717
  children: [
1702
1718
  /* @__PURE__ */ jsx16("span", { children: label }),
@@ -1839,7 +1855,7 @@ function ResizableHandle({
1839
1855
  }
1840
1856
 
1841
1857
  // src/components/scroll-area/scroll-area.tsx
1842
- import * as React7 from "react";
1858
+ import * as React8 from "react";
1843
1859
  import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
1844
1860
  var MIN_THUMB_SIZE_PX = 24;
1845
1861
  function ScrollArea({
@@ -1935,9 +1951,9 @@ function CustomScrollArea({
1935
1951
  viewportTestId,
1936
1952
  ...props
1937
1953
  }) {
1938
- const localViewportRef = React7.useRef(null);
1939
- const contentRef = React7.useRef(null);
1940
- const [active, setActive] = React7.useState(false);
1954
+ const localViewportRef = React8.useRef(null);
1955
+ const contentRef = React8.useRef(null);
1956
+ const [active, setActive] = React8.useState(false);
1941
1957
  const alwaysVisible = type === "always" || type === "scroll" || hasAlwaysVisibleScrollbarSelector(className);
1942
1958
  return /* @__PURE__ */ jsxs9(
1943
1959
  ScrollAreaFrame,
@@ -2045,15 +2061,15 @@ function ScrollAreaScrollbar({
2045
2061
  orientation,
2046
2062
  viewportRef
2047
2063
  }) {
2048
- const trackRef = React7.useRef(null);
2049
- const thumbRef = React7.useRef(null);
2050
- const dragStateRef = React7.useRef(null);
2051
- const frameRef = React7.useRef(null);
2052
- const scrollableRef = React7.useRef(false);
2053
- const [dragging, setDragging] = React7.useState(false);
2054
- const [scrollable, setScrollable] = React7.useState(false);
2055
- const [trackActive, setTrackActive] = React7.useState(false);
2056
- const syncScrollbarState = React7.useCallback(() => {
2064
+ const trackRef = React8.useRef(null);
2065
+ const thumbRef = React8.useRef(null);
2066
+ const dragStateRef = React8.useRef(null);
2067
+ const frameRef = React8.useRef(null);
2068
+ const scrollableRef = React8.useRef(false);
2069
+ const [dragging, setDragging] = React8.useState(false);
2070
+ const [scrollable, setScrollable] = React8.useState(false);
2071
+ const [trackActive, setTrackActive] = React8.useState(false);
2072
+ const syncScrollbarState = React8.useCallback(() => {
2057
2073
  const viewport = viewportRef.current;
2058
2074
  const track = trackRef.current;
2059
2075
  const thumb = thumbRef.current;
@@ -2092,7 +2108,7 @@ function ScrollAreaScrollbar({
2092
2108
  }
2093
2109
  updateScrollable(true, scrollableRef, setScrollable);
2094
2110
  }, [orientation, viewportRef]);
2095
- const scheduleSync = React7.useCallback(() => {
2111
+ const scheduleSync = React8.useCallback(() => {
2096
2112
  if (frameRef.current !== null) {
2097
2113
  return;
2098
2114
  }
@@ -2101,7 +2117,7 @@ function ScrollAreaScrollbar({
2101
2117
  syncScrollbarState();
2102
2118
  });
2103
2119
  }, [syncScrollbarState]);
2104
- const scrollViewportToThumbOffset = React7.useCallback(
2120
+ const scrollViewportToThumbOffset = React8.useCallback(
2105
2121
  (thumbOffset) => {
2106
2122
  const viewport = viewportRef.current;
2107
2123
  const track = trackRef.current;
@@ -2128,7 +2144,7 @@ function ScrollAreaScrollbar({
2128
2144
  },
2129
2145
  [orientation, syncScrollbarState, viewportRef]
2130
2146
  );
2131
- const handleTrackPointerDown = React7.useCallback(
2147
+ const handleTrackPointerDown = React8.useCallback(
2132
2148
  (event) => {
2133
2149
  if (event.button !== 0 || !scrollableRef.current) {
2134
2150
  return;
@@ -2148,7 +2164,7 @@ function ScrollAreaScrollbar({
2148
2164
  },
2149
2165
  [orientation, scrollViewportToThumbOffset]
2150
2166
  );
2151
- const handleThumbPointerDown = React7.useCallback(
2167
+ const handleThumbPointerDown = React8.useCallback(
2152
2168
  (event) => {
2153
2169
  if (event.button !== 0 || !scrollableRef.current) {
2154
2170
  return;
@@ -2180,7 +2196,7 @@ function ScrollAreaScrollbar({
2180
2196
  },
2181
2197
  [orientation, viewportRef]
2182
2198
  );
2183
- React7.useEffect(() => {
2199
+ React8.useEffect(() => {
2184
2200
  if (!dragging) {
2185
2201
  return;
2186
2202
  }
@@ -2211,7 +2227,7 @@ function ScrollAreaScrollbar({
2211
2227
  window.removeEventListener("pointerup", handlePointerUp);
2212
2228
  };
2213
2229
  }, [dragging, orientation, syncScrollbarState, viewportRef]);
2214
- React7.useEffect(() => {
2230
+ React8.useEffect(() => {
2215
2231
  const viewport = viewportRef.current;
2216
2232
  if (!viewport) {
2217
2233
  updateScrollable(false, scrollableRef, setScrollable);
@@ -2233,7 +2249,7 @@ function ScrollAreaScrollbar({
2233
2249
  resizeObserver?.disconnect();
2234
2250
  };
2235
2251
  }, [contentRef, scheduleSync, syncScrollbarState, viewportRef]);
2236
- React7.useEffect(() => {
2252
+ React8.useEffect(() => {
2237
2253
  scheduleSync();
2238
2254
  });
2239
2255
  return /* @__PURE__ */ jsx20(
@@ -2945,7 +2961,7 @@ function Textarea({ className, ...props }) {
2945
2961
  }
2946
2962
 
2947
2963
  // src/components/toast/toast.tsx
2948
- import * as React8 from "react";
2964
+ import * as React9 from "react";
2949
2965
  import { Toast as ToastPrimitive } from "radix-ui";
2950
2966
  import { cva as cva5 } from "class-variance-authority";
2951
2967
  import { jsx as jsx30, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -2956,7 +2972,7 @@ function ToastProvider({
2956
2972
  }) {
2957
2973
  return /* @__PURE__ */ jsx30(ToastPrimitive.Provider, { duration, ...props });
2958
2974
  }
2959
- var ToastVisualContext = React8.createContext(null);
2975
+ var ToastVisualContext = React9.createContext(null);
2960
2976
  var toastStatusIconByVariant = {
2961
2977
  destructive: FailedFilledIcon,
2962
2978
  success: SuccessFilledIcon
@@ -2980,7 +2996,7 @@ function formatToastText(children) {
2980
2996
  if (typeof children === "string") {
2981
2997
  return stripToastTrailingSentencePunctuation(children);
2982
2998
  }
2983
- const flatChildren = React8.Children.toArray(children);
2999
+ const flatChildren = React9.Children.toArray(children);
2984
3000
  if (flatChildren.length === 1 && typeof flatChildren[0] === "string") {
2985
3001
  return stripToastTrailingSentencePunctuation(flatChildren[0]);
2986
3002
  }
@@ -3038,7 +3054,7 @@ function ToastTitle({
3038
3054
  children,
3039
3055
  ...props
3040
3056
  }) {
3041
- const toastVisual = React8.useContext(ToastVisualContext);
3057
+ const toastVisual = React9.useContext(ToastVisualContext);
3042
3058
  const StatusIcon = toastVisual?.variant && hasToastStatusIcon(toastVisual.variant) ? toastStatusIconByVariant[toastVisual.variant] : null;
3043
3059
  return /* @__PURE__ */ jsxs12(
3044
3060
  ToastPrimitive.Title,
@@ -3117,7 +3133,7 @@ function ToastViewport({
3117
3133
  }
3118
3134
 
3119
3135
  // src/components/underline-tabs/underline-tabs.tsx
3120
- import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState5 } from "react";
3136
+ import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState6 } from "react";
3121
3137
  import { jsx as jsx31, jsxs as jsxs13 } from "react/jsx-runtime";
3122
3138
  function UnderlineTabs({
3123
3139
  tabs,
@@ -3136,8 +3152,8 @@ function UnderlineTabs({
3136
3152
  const viewportRef = useRef4(null);
3137
3153
  const rowRef = useRef4(null);
3138
3154
  const buttonRefs = useRef4({});
3139
- const [indicatorStyle, setIndicatorStyle] = useState5({ left: 0, width: 0 });
3140
- const [overflow, setOverflow] = useState5({
3155
+ const [indicatorStyle, setIndicatorStyle] = useState6({ left: 0, width: 0 });
3156
+ const [overflow, setOverflow] = useState6({
3141
3157
  canScrollLeft: false,
3142
3158
  canScrollRight: false
3143
3159
  });
@@ -3316,7 +3332,7 @@ function UnderlineTabs({
3316
3332
  }
3317
3333
 
3318
3334
  // src/components/viewport-menu-surface/viewport-menu-surface.tsx
3319
- import * as React9 from "react";
3335
+ import * as React10 from "react";
3320
3336
  import { createPortal as createPortal2 } from "react-dom";
3321
3337
  import { jsx as jsx32 } from "react/jsx-runtime";
3322
3338
  var VIEWPORT_MENU_PADDING = 12;
@@ -3430,7 +3446,7 @@ function assignRef(ref, value) {
3430
3446
  function callHandler(handler, event) {
3431
3447
  handler?.(event);
3432
3448
  }
3433
- var ViewportMenuSurface = React9.forwardRef(function ViewportMenuSurface2({
3449
+ var ViewportMenuSurface = React10.forwardRef(function ViewportMenuSurface2({
3434
3450
  open,
3435
3451
  placement,
3436
3452
  children,
@@ -3446,16 +3462,16 @@ var ViewportMenuSurface = React9.forwardRef(function ViewportMenuSurface2({
3446
3462
  className,
3447
3463
  ...rest
3448
3464
  }, forwardedRef) {
3449
- const surfaceRef = React9.useRef(null);
3450
- const [measuredSize, setMeasuredSize] = React9.useState(null);
3451
- const setRefs2 = React9.useCallback(
3465
+ const surfaceRef = React10.useRef(null);
3466
+ const [measuredSize, setMeasuredSize] = React10.useState(null);
3467
+ const setRefs2 = React10.useCallback(
3452
3468
  (node) => {
3453
3469
  surfaceRef.current = node;
3454
3470
  assignRef(forwardedRef, node);
3455
3471
  },
3456
3472
  [forwardedRef]
3457
3473
  );
3458
- React9.useLayoutEffect(() => {
3474
+ React10.useLayoutEffect(() => {
3459
3475
  if (!open) {
3460
3476
  setMeasuredSize(null);
3461
3477
  return;
@@ -3479,7 +3495,7 @@ var ViewportMenuSurface = React9.forwardRef(function ViewportMenuSurface2({
3479
3495
  observer.observe(element);
3480
3496
  return () => observer.disconnect();
3481
3497
  }, [open, placement]);
3482
- React9.useEffect(() => {
3498
+ React10.useEffect(() => {
3483
3499
  if (!open) {
3484
3500
  return;
3485
3501
  }
@@ -3536,7 +3552,7 @@ var ViewportMenuSurface = React9.forwardRef(function ViewportMenuSurface2({
3536
3552
  onDismiss,
3537
3553
  open
3538
3554
  ]);
3539
- const resolvedPlacement = React9.useMemo(() => {
3555
+ const resolvedPlacement = React10.useMemo(() => {
3540
3556
  if (placement.type === "absolute") {
3541
3557
  const boundary2 = resolveMenuBoundaryFromPoint(
3542
3558
  placement.boundaryPoint ?? {
@@ -3737,4 +3753,4 @@ export {
3737
3753
  UnderlineTabs,
3738
3754
  ViewportMenuSurface
3739
3755
  };
3740
- //# sourceMappingURL=chunk-XKU7P7UM.js.map
3756
+ //# sourceMappingURL=chunk-R7ZLHOKX.js.map