@lovett/ui 0.2.5 → 0.2.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.ts CHANGED
@@ -7368,6 +7368,24 @@ declare function CommentBody({ bodyMd, onSelectMention, className }: CommentBody
7368
7368
  */
7369
7369
  declare const THREAD_REACTION_KEYS: readonly ["up", "heart", "celebrate", "eyes", "check", "question"];
7370
7370
  type ThreadReactionKey = (typeof THREAD_REACTION_KEYS)[number];
7371
+ /**
7372
+ * FOCUS RINGS IN THIS MODULE ARE INSET. All of them, without exception.
7373
+ *
7374
+ * Not a preference — a consequence of where this module renders. `comment.tsx`
7375
+ * wraps the whole reply subtree in the `overflow-hidden` that its grid-rows
7376
+ * reveal requires; `Card` clips by default; a thread lives in a scroll
7377
+ * container. An OUTSET `box-shadow` ring is clipped by any of those, and a
7378
+ * clipped focus ring does not degrade — it DISAPPEARS, which is a WCAG 2.4.7
7379
+ * failure rather than a cosmetic one.
7380
+ *
7381
+ * So: `var(--ring-focus-inset)` on every focusable thing in `src/thread/`, and
7382
+ * `var(--ring-focus)` is a bug here. It was found the slow way — the owner
7383
+ * reported the reply composer clipped, that one was fixed, and switching to the
7384
+ * rich editor clipped the next one. Fourteen more were waiting. Fixing them by
7385
+ * report is a queue with no end; the rule is the fix.
7386
+ *
7387
+ * Outside this module the outset ring is still correct and still the default.
7388
+ */
7371
7389
  /** One reaction row as the API groups it: key, tally, and the viewer's own state. */
7372
7390
  interface ThreadReactionCount {
7373
7391
  readonly key: ThreadReactionKey;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { cn, composeRefs, useAnchoredPosition, useLayer, useOutsideClick, POPOVER_SURFACE_STYLE, __export, Input, Popover, handleTabTrap, Button, Kbd, usePrefersReducedMotion, QUIET_ICON_BOX, QUIET_ICON, RichThreadComposer, ThreadComposer, CommentBody, tabbablesWithin, AttachmentImage, AttachmentGif } from './chunk-GP7BKVZC.js';
2
- export { ATTACHMENT_ACCEPT, ATTACHMENT_LIMITS, AttachmentButton, AttachmentDropZone, AttachmentGif, AttachmentImage, AttachmentLightbox, AttachmentPlaceholder, AttachmentTray, Button, CodeBlock, CommentBody, GIF_SEARCH_DEBOUNCE_MS, GifPicker, Input, Kbd, MarkdownCode, MarkdownRenderer, PASTE_ATTACHMENT_THRESHOLD, POPOVER_SURFACE_STYLE, Popover, RichThreadComposer, ThreadComposer, applyMarkdownFormat, cn, computeAnchoredPosition, formatAttachmentSize, parseMentionHref, pastedTextFilename, shouldAttachPaste, useAnchoredPosition, useAttachmentUrl, useAttachments, useEscapeKey, useLayer, useOutsideClick, usePrefersReducedMotion } from './chunk-GP7BKVZC.js';
1
+ import { cn, composeRefs, useAnchoredPosition, useLayer, useOutsideClick, POPOVER_SURFACE_STYLE, __export, Input, Popover, handleTabTrap, Button, Kbd, usePrefersReducedMotion, QUIET_ICON_BOX, QUIET_ICON, RichThreadComposer, ThreadComposer, CommentBody, tabbablesWithin, AttachmentImage, AttachmentGif } from './chunk-6XT32ETQ.js';
2
+ export { ATTACHMENT_ACCEPT, ATTACHMENT_LIMITS, AttachmentButton, AttachmentDropZone, AttachmentGif, AttachmentImage, AttachmentLightbox, AttachmentPlaceholder, AttachmentTray, Button, CodeBlock, CommentBody, GIF_SEARCH_DEBOUNCE_MS, GifPicker, Input, Kbd, MarkdownCode, MarkdownRenderer, PASTE_ATTACHMENT_THRESHOLD, POPOVER_SURFACE_STYLE, Popover, RichThreadComposer, ThreadComposer, applyMarkdownFormat, cn, computeAnchoredPosition, formatAttachmentSize, parseMentionHref, pastedTextFilename, shouldAttachPaste, useAnchoredPosition, useAttachmentUrl, useAttachments, useEscapeKey, useLayer, useOutsideClick, usePrefersReducedMotion } from './chunk-6XT32ETQ.js';
3
3
  import React2, { forwardRef, Children, isValidElement, createContext, useContext, useId, useRef, useEffect, useMemo, useCallback, useState, useLayoutEffect, memo, useSyncExternalStore, cloneElement, Fragment as Fragment$1 } from 'react';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { Minus, Check, ChevronDown, X, Loader2, Play, VolumeX, Volume2, ChevronUp, Link2, ChevronLeft, MoreHorizontal, ThumbsUp as ThumbsUp$1, MessageCircle, Share2, Search, Plus, ChevronRight, CircleX, CircleCheck, CircleSlash, CircleDotDashed, Circle, CircleDashed, Pencil, House, GripVertical, Folder, Flag, ImageOff, ChevronsUpDown, SlidersHorizontal, Copy, FolderClosed, FolderPlus, Paperclip, Upload, Image, Code, Table as Table$1, FileText, FileType, AlertCircle, RotateCcw, ArrowRight, ListFilter, ArrowLeft, ArrowDown, ArrowUp, Info, ChartLine, Table2, Inbox, TriangleAlert, ChevronsLeft, ChevronsUp, ChevronsRight, ChevronsDown, Star, Settings2, CornerDownRight, Trash2, SmilePlus, ArrowBigUp, ArrowBigDown, ExternalLink, RotateCw, MessageSquare, Lock, PanelRight, SquareDashed, Maximize2, Archive, Printer, Repeat2, CornerUpRight } from 'lucide-react';
@@ -24289,7 +24289,7 @@ var QUIET = cn(
24289
24289
  "transition-[background-color,color] duration-[var(--dur-fast)] ease-[var(--ease-out)]",
24290
24290
  "motion-reduce:transition-none",
24291
24291
  "hover:bg-[rgb(var(--surface-overlay))] hover:text-[rgb(var(--foreground))]",
24292
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]",
24292
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]",
24293
24293
  "disabled:cursor-default disabled:opacity-60"
24294
24294
  );
24295
24295
  var QUIET_BOX = {
@@ -24590,7 +24590,7 @@ function CommentVote({
24590
24590
  "inline-flex items-center justify-center border border-transparent",
24591
24591
  "transition-[color,background-color,transform] duration-[var(--dur-fast)] ease-[var(--ease-out)]",
24592
24592
  "motion-reduce:transition-none",
24593
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]",
24593
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]",
24594
24594
  "active:scale-[0.96] motion-reduce:active:scale-100",
24595
24595
  "disabled:cursor-not-allowed disabled:opacity-60",
24596
24596
  active ? "text-[rgb(var(--accent-ink))]" : "text-[rgb(var(--text-tertiary))] hover:bg-[rgb(var(--surface-hover))] hover:text-[rgb(var(--foreground))]"
@@ -24835,7 +24835,7 @@ function LinkPreview({ preview, onHide, className }) {
24835
24835
  onClick: () => {
24836
24836
  setPlaying(true);
24837
24837
  },
24838
- className: "absolute inset-0 flex items-center justify-center focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]",
24838
+ className: "absolute inset-0 flex items-center justify-center focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]",
24839
24839
  style: {
24840
24840
  // diag:contrast-ok — this scrim sits on a PHOTOGRAPH, which
24841
24841
  // is the one thing check-contrast says it cannot see:
@@ -24870,7 +24870,7 @@ function LinkPreview({ preview, onHide, className }) {
24870
24870
  rel: "noopener noreferrer",
24871
24871
  className: cn(
24872
24872
  "group/link block min-w-0 flex-1 no-underline",
24873
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]"
24873
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]"
24874
24874
  ),
24875
24875
  style: { borderRadius: "var(--radius-xs)" },
24876
24876
  children: [
@@ -24980,7 +24980,7 @@ function ThreadRail({ collapsed, label, onToggle }) {
24980
24980
  "motion-reduce:transition-none",
24981
24981
  "group-hover/rail:border-[rgb(var(--border-strong))] group-hover/rail:text-[rgb(var(--foreground))]",
24982
24982
  "group-focus-visible/rail:border-[rgb(var(--accent))] group-focus-visible/rail:text-[rgb(var(--accent-ink))]",
24983
- "group-focus-visible/rail:[box-shadow:var(--ring-focus)]",
24983
+ "group-focus-visible/rail:[box-shadow:var(--ring-focus-inset)]",
24984
24984
  "group-active/rail:scale-[0.96] motion-reduce:group-active/rail:scale-100"
24985
24985
  ),
24986
24986
  style: {
@@ -25112,7 +25112,7 @@ function CollapsedReplies({
25112
25112
  "transition-[background-color,border-color,color] duration-[var(--dur-fast)] ease-[var(--ease-out)]",
25113
25113
  "motion-reduce:transition-none",
25114
25114
  "hover:border-[rgb(var(--border-strong))] hover:bg-[rgb(var(--surface-hover))] hover:text-[rgb(var(--foreground))]",
25115
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]"
25115
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]"
25116
25116
  ),
25117
25117
  style: { minBlockSize: "var(--space-6)", borderRadius: "var(--radius-sm)" },
25118
25118
  children: [
@@ -25229,7 +25229,7 @@ function Attachments({
25229
25229
  "border-[rgb(var(--border))] bg-[rgb(var(--surface-inset))] text-[rgb(var(--text-secondary))]",
25230
25230
  "transition-[background-color,border-color] duration-[var(--dur-fast)] ease-[var(--ease-out)] motion-reduce:transition-none",
25231
25231
  "enabled:hover:border-[rgb(var(--border-strong))] enabled:hover:bg-[rgb(var(--surface-hover))]",
25232
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]",
25232
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]",
25233
25233
  "disabled:cursor-default"
25234
25234
  ),
25235
25235
  style: { borderRadius: "var(--thread-inner-radius, var(--radius-sm))" },
@@ -25367,7 +25367,7 @@ function CommentItem({
25367
25367
  className: cn(
25368
25368
  "min-w-0 truncate text-[14px] font-semibold text-[rgb(var(--foreground))]",
25369
25369
  "underline-offset-2 hover:underline",
25370
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]"
25370
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]"
25371
25371
  ),
25372
25372
  style: { borderRadius: "var(--radius-xs)" },
25373
25373
  children: label
@@ -25910,7 +25910,7 @@ function SortPills({
25910
25910
  "inline-flex h-[24px] items-center px-[var(--space-2)] text-[12px] font-semibold",
25911
25911
  "transition-[background-color,color,border-color,box-shadow] duration-[var(--dur-fast)] ease-[var(--ease-out)]",
25912
25912
  "motion-reduce:transition-none",
25913
- "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus)]",
25913
+ "focus-visible:outline-none focus-visible:[box-shadow:var(--ring-focus-inset)]",
25914
25914
  active ? "border border-[rgb(var(--accent))] bg-[rgb(var(--surface-card))] text-[rgb(var(--accent-ink))] [box-shadow:var(--shadow-sm)]" : "border border-transparent text-[rgb(var(--text-tertiary))] hover:text-[rgb(var(--foreground))]"
25915
25915
  ),
25916
25916
  style: { borderRadius: "var(--radius-xs)" },