@botiverse/raft-ui 0.21.0 → 0.21.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.
package/dist/wip.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { An as Tooltip, Bn as DialogClose, Fn as TextLink, Gt as readNow, Ht as measureContent, Pn as TooltipTrigger, Rn as Dialog, Ut as measureElement, Vn as DialogContent, Vt as useOverflowTitle, Wt as observeTruncation, Xn as DialogTrigger, Yn as DialogTitle, Zn as Button$1, a as MessageListJumpPillDismiss, ar as useTheme, dt as MessageItemDelegatedAvatar, er as defaultNativeButton, ft as MessageItemDelegatedBy, h as MessageQuotedPreviewAuthorDelegatedBy, i as MessageListJumpPill, ir as useThemeScopeProps, jn as TooltipContent, mt as MessageItemDelegatedByName, o as MessageListJumpPillGroup, pt as MessageItemDelegatedByButton, r as MessageListJumpControls, sr as tv, t as useHoldThenMoveTouchSensor } from "./touch-drag-B7uLTWXe.mjs";
1
+ import { $n as DialogTitle, Fn as TooltipContent, Gn as DialogContent, Gt as measureContent, Hn as Dialog, Jt as readNow, Kt as measureElement, Pn as Tooltip, Rn as TooltipTrigger, Wn as DialogClose, Wt as useOverflowTitle, _ as MessageQuotedPreviewAuthorDelegatedBy, _t as MessageItemDelegatedByName, a as MessageListJumpPill, cr as useThemeScopeProps, dr as tv, er as DialogTrigger, gt as MessageItemDelegatedByButton, ht as MessageItemDelegatedBy, i as MessageListJumpControls, in as DropdownMenuLinkItem, ir as defaultNativeButton, lr as useTheme, mt as MessageItemDelegatedAvatar, n as useHoldThenMoveTouchSensor, o as MessageListJumpPillDismiss, qt as observeTruncation, s as MessageListJumpPillGroup, t as inboxItem, tr as Button$1, zn as TextLink } from "./inbox-item.recipe-CuJPcy-3.mjs";
2
2
  import { Check, ChevronDown, LoaderCircle, Plus, X } from "lucide-react";
3
3
  import { createContext, use, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -6,6 +6,7 @@ import { Button } from "@base-ui/react/button";
6
6
  import { mergeProps } from "@base-ui/react/merge-props";
7
7
  import { useRender } from "@base-ui/react/use-render";
8
8
  import { Combobox } from "@base-ui/react/combobox";
9
+ import { Meter as Meter$1 } from "@base-ui/react/meter";
9
10
  //#region src/lib/phone-media.ts
10
11
  /**
11
12
  * A phone: a touch screen narrower than the desktop layout. The complement, on
@@ -1467,4 +1468,150 @@ function useTruncated(ref) {
1467
1468
  return truncated;
1468
1469
  }
1469
1470
  //#endregion
1470
- export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, Ellipsis, EllipsisToggle, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useHoldThenMoveTouchSensor, useTruncated };
1471
+ //#region src/components/inbox-item/inbox-item-leading-badge.tsx
1472
+ /**
1473
+ * A small badge in the bottom-right corner of `InboxItemLeading`, the corner a
1474
+ * presence light takes: on a thread row, the thread mark, on the channel's
1475
+ * `IconTile` or on the direct message's `Avatar` alike. Put it inside
1476
+ * `InboxItemLeading`, after the tile or avatar, with one icon as its child;
1477
+ * leave the avatar's `AvatarBadge` out, since the corner holds one mark. It
1478
+ * is hidden from assistive technology unless given a `role`.
1479
+ */
1480
+ function InboxItemLeadingBadge({ className, render, ...props }) {
1481
+ const { itemLeadingBadge } = inboxItem();
1482
+ const defaultProps = {
1483
+ "data-slot": "inbox-item-leading-badge",
1484
+ "aria-hidden": props.role ? void 0 : true,
1485
+ className: itemLeadingBadge({ className })
1486
+ };
1487
+ return useRender({
1488
+ defaultTagName: "span",
1489
+ render,
1490
+ props: mergeProps(defaultProps, props)
1491
+ });
1492
+ }
1493
+ //#endregion
1494
+ //#region src/components/meter/meter.tsx
1495
+ const meter = tv({
1496
+ slots: {
1497
+ root: [
1498
+ "group/meter grid w-full min-w-0 gap-1.5",
1499
+ "[--meter-indicator:var(--info)]",
1500
+ "[--meter-track:var(--fill-muted)]",
1501
+ "[--meter-track-edge:transparent]",
1502
+ "[--meter-value:var(--foreground-muted)]",
1503
+ "font-sans"
1504
+ ],
1505
+ header: ["flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5"],
1506
+ label: ["min-w-0 truncate", "text-footnote font-semibold text-foreground"],
1507
+ value: ["shrink-0 text-right tabular-nums", "text-footnote text-(--meter-value)"],
1508
+ track: [
1509
+ "relative w-full overflow-hidden bg-(--meter-track)",
1510
+ "inset-ring-1 inset-ring-(--meter-track-edge)",
1511
+ "h-2 group-data-[size=sm]/meter:h-1.5",
1512
+ "rounded-sticker"
1513
+ ],
1514
+ indicator: [
1515
+ "block h-full bg-(--meter-indicator)",
1516
+ "transition-[width,background-color] duration-200 ease-out",
1517
+ "rounded-[inherit] inset-ring-[1.5px] inset-ring-sticker-ink"
1518
+ ]
1519
+ },
1520
+ variants: {
1521
+ level: {
1522
+ plenty: {},
1523
+ low: { root: ["[--meter-indicator:var(--warning)]", "[--meter-value:var(--warning-strong)]"] },
1524
+ empty: { root: [
1525
+ "[--meter-track:var(--warning-muted)]",
1526
+ "[--meter-track-edge:var(--warning)]",
1527
+ "[--meter-value:var(--warning-strong)]"
1528
+ ] }
1529
+ },
1530
+ size: {
1531
+ sm: {},
1532
+ md: {}
1533
+ }
1534
+ },
1535
+ defaultVariants: {
1536
+ level: "plenty",
1537
+ size: "md"
1538
+ }
1539
+ });
1540
+ const MeterTextContext = createContext("");
1541
+ function clamp(value, min, max) {
1542
+ return Math.min(max, Math.max(min, Number.isNaN(value) ? min : value));
1543
+ }
1544
+ /**
1545
+ * How much of an allowance is left, such as a usage limit that resets. Takes
1546
+ * what is `used`; the bar shows what is left, full to start and draining.
1547
+ * The info fill, like Progress, until `low` or less is left, then the warning
1548
+ * color; never danger, and no success color at full.
1549
+ */
1550
+ function Meter({ size = "md", used, max = 100, low, valueText, className, ...props }) {
1551
+ const left = max - clamp(used, 0, max);
1552
+ const lowAt = clamp(low ?? max * .2, 0, max);
1553
+ const level = left <= 0 ? "empty" : left <= lowAt ? "low" : "plenty";
1554
+ const { root } = meter({
1555
+ size,
1556
+ level
1557
+ });
1558
+ return /* @__PURE__ */ jsx(MeterTextContext.Provider, {
1559
+ value: valueText,
1560
+ children: /* @__PURE__ */ jsx(Meter$1.Root, {
1561
+ "data-slot": "meter",
1562
+ "data-size": size,
1563
+ "data-level": level,
1564
+ min: 0,
1565
+ max,
1566
+ value: left,
1567
+ "aria-valuetext": valueText,
1568
+ className: root({ className }),
1569
+ ...props
1570
+ })
1571
+ });
1572
+ }
1573
+ function MeterHeader({ className, ...props }) {
1574
+ const { header } = meter();
1575
+ return /* @__PURE__ */ jsx("div", {
1576
+ "data-slot": "meter-header",
1577
+ className: header({ className }),
1578
+ ...props
1579
+ });
1580
+ }
1581
+ function MeterLabel({ className, ...props }) {
1582
+ const { label } = meter();
1583
+ return /* @__PURE__ */ jsx(Meter$1.Label, {
1584
+ "data-slot": "meter-label",
1585
+ className: label({ className }),
1586
+ ...props
1587
+ });
1588
+ }
1589
+ /** Shows the meter's `valueText`, at the end of `MeterHeader`. */
1590
+ function MeterValue({ className, ...props }) {
1591
+ const { value } = meter();
1592
+ const valueText = useContext(MeterTextContext);
1593
+ return /* @__PURE__ */ jsx(Meter$1.Value, {
1594
+ "data-slot": "meter-value",
1595
+ className: value({ className }),
1596
+ ...props,
1597
+ children: () => valueText
1598
+ });
1599
+ }
1600
+ function MeterTrack({ className, ...props }) {
1601
+ const { track } = meter();
1602
+ return /* @__PURE__ */ jsx(Meter$1.Track, {
1603
+ "data-slot": "meter-track",
1604
+ className: track({ className }),
1605
+ ...props
1606
+ });
1607
+ }
1608
+ function MeterIndicator({ className, ...props }) {
1609
+ const { indicator } = meter();
1610
+ return /* @__PURE__ */ jsx(Meter$1.Indicator, {
1611
+ "data-slot": "meter-indicator",
1612
+ className: indicator({ className }),
1613
+ ...props
1614
+ });
1615
+ }
1616
+ //#endregion
1617
+ export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, DropdownMenuLinkItem, Ellipsis, EllipsisToggle, InboxItemLeadingBadge, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, Meter, MeterHeader, MeterIndicator, MeterLabel, MeterTrack, MeterValue, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useHoldThenMoveTouchSensor, useTruncated };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botiverse/raft-ui",
3
- "version": "0.21.0",
3
+ "version": "0.21.2",
4
4
  "description": "React components and CSS foundations for the Raft Design System.",
5
5
  "keywords": [
6
6
  "agent-skills",