@stll/ui 0.80.0 → 0.81.0

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.
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Marks one item's natural-width copy inside the measuring row; its value is
3
+ * the item's key.
4
+ */
5
+ export declare const INLINE_OVERFLOW_ITEM_ATTRIBUTE = "data-inline-overflow-item";
6
+ /** Marks the overflow trigger's copy inside the measuring row. */
7
+ export declare const INLINE_OVERFLOW_TRIGGER_ATTRIBUTE = "data-inline-overflow-trigger";
8
+ type UseInlineOverflowOptions = {
9
+ /** The active item's index; the policy keeps it on screen. */
10
+ activeIndex: number;
11
+ /**
12
+ * Each item's key, in display order; the measuring copy of an item carries
13
+ * its key in `INLINE_OVERFLOW_ITEM_ATTRIBUTE`.
14
+ */
15
+ itemKeys: readonly string[];
16
+ };
17
+ /**
18
+ * Measures a single-line row and decides how many of its items fit, by
19
+ * `resolveInlineOverflow`. The caller renders two things:
20
+ *
21
+ * - the row (`containerRef`), whose content box is the room the items and
22
+ * the overflow trigger share, independent of how many items it shows;
23
+ * - an invisible, inert copy of every item at its natural width plus the
24
+ * trigger (`measureRef`), each marked with `INLINE_OVERFLOW_ITEM_ATTRIBUTE`
25
+ * (set to the item's key) or `INLINE_OVERFLOW_TRIGGER_ATTRIBUTE`, inside
26
+ * one flex row whose gap is the gap between items.
27
+ *
28
+ * Measuring the copy keeps the widths stable however many items the row is
29
+ * currently showing, so collapsing an item never changes the measurement
30
+ * that collapsed it. Widths are read by key in the order `itemKeys` gives,
31
+ * and the count is recomputed whenever either element resizes (a docked
32
+ * pane narrows the row, an added view or a rename widens the copy), the
33
+ * active item changes, or the items change order: swapping two items keeps
34
+ * the measuring row's size, which no observer reports. The first count
35
+ * arrives with the observer's first report, before the row paints; until
36
+ * then every item shows.
37
+ */
38
+ export declare const useInlineOverflow: ({ activeIndex, itemKeys }: UseInlineOverflowOptions) => {
39
+ /** The measured row, once mounted. */
40
+ container: HTMLElement | null;
41
+ containerRef: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
42
+ /** Whether the row has been measured; until then every item shows. */
43
+ measured: boolean;
44
+ measureRef: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
45
+ visibleCount: number;
46
+ };
47
+ export {};
@@ -0,0 +1,93 @@
1
+ import { resolveInlineOverflow } from "../lib/inline-overflow.js";
2
+ import { useEffect, useState } from "react";
3
+ // src/hooks/use-inline-overflow.ts
4
+ /**
5
+ * Marks one item's natural-width copy inside the measuring row; its value is
6
+ * the item's key.
7
+ */
8
+ const INLINE_OVERFLOW_ITEM_ATTRIBUTE = "data-inline-overflow-item";
9
+ /** Marks the overflow trigger's copy inside the measuring row. */
10
+ const INLINE_OVERFLOW_TRIGGER_ATTRIBUTE = "data-inline-overflow-trigger";
11
+ /** Joins item keys into one value the effect can depend on. */
12
+ const KEY_SEPARATOR = "\0";
13
+ /**
14
+ * The space between two neighbouring copies, read off their boxes in either
15
+ * reading direction; the copies sit in one row, so it is the row's gap.
16
+ */
17
+ const itemGap = (items) => {
18
+ const [first, second] = items;
19
+ if (first === void 0 || second === void 0) return 0;
20
+ return Math.max(0, second.left - first.right, first.left - second.right);
21
+ };
22
+ /**
23
+ * Measures a single-line row and decides how many of its items fit, by
24
+ * `resolveInlineOverflow`. The caller renders two things:
25
+ *
26
+ * - the row (`containerRef`), whose content box is the room the items and
27
+ * the overflow trigger share, independent of how many items it shows;
28
+ * - an invisible, inert copy of every item at its natural width plus the
29
+ * trigger (`measureRef`), each marked with `INLINE_OVERFLOW_ITEM_ATTRIBUTE`
30
+ * (set to the item's key) or `INLINE_OVERFLOW_TRIGGER_ATTRIBUTE`, inside
31
+ * one flex row whose gap is the gap between items.
32
+ *
33
+ * Measuring the copy keeps the widths stable however many items the row is
34
+ * currently showing, so collapsing an item never changes the measurement
35
+ * that collapsed it. Widths are read by key in the order `itemKeys` gives,
36
+ * and the count is recomputed whenever either element resizes (a docked
37
+ * pane narrows the row, an added view or a rename widens the copy), the
38
+ * active item changes, or the items change order: swapping two items keeps
39
+ * the measuring row's size, which no observer reports. The first count
40
+ * arrives with the observer's first report, before the row paints; until
41
+ * then every item shows.
42
+ */
43
+ const useInlineOverflow = ({ activeIndex, itemKeys }) => {
44
+ const itemCount = itemKeys.length;
45
+ const order = itemKeys.join(KEY_SEPARATOR);
46
+ const [container, setContainer] = useState(null);
47
+ const [measure, setMeasure] = useState(null);
48
+ const [visibleCount, setVisibleCount] = useState(itemCount);
49
+ const [measured, setMeasured] = useState(false);
50
+ useEffect(() => {
51
+ if (!container || !measure) return;
52
+ const keys = order === "" ? [] : order.split(KEY_SEPARATOR);
53
+ let availableWidth = 0;
54
+ const recompute = () => {
55
+ const copies = Array.from(measure.querySelectorAll(`[${INLINE_OVERFLOW_ITEM_ATTRIBUTE}]`), (copy) => ({
56
+ key: copy.getAttribute(INLINE_OVERFLOW_ITEM_ATTRIBUTE),
57
+ box: copy.getBoundingClientRect()
58
+ }));
59
+ const boxByKey = new Map(copies.map(({ key, box }) => [key, box]));
60
+ const trigger = measure.querySelector(`[${INLINE_OVERFLOW_TRIGGER_ATTRIBUTE}]`);
61
+ setVisibleCount(resolveInlineOverflow({
62
+ activeIndex,
63
+ availableWidth,
64
+ gap: itemGap(copies.map(({ box }) => box)),
65
+ itemWidths: keys.map((key) => boxByKey.get(key)?.width ?? 0),
66
+ triggerWidth: trigger?.getBoundingClientRect().width ?? 0
67
+ }).visibleCount);
68
+ setMeasured(true);
69
+ };
70
+ const observer = new ResizeObserver((entries) => {
71
+ for (const entry of entries) if (entry.target === container) availableWidth = entry.contentRect.width;
72
+ recompute();
73
+ });
74
+ observer.observe(container);
75
+ observer.observe(measure);
76
+ return () => observer.disconnect();
77
+ }, [
78
+ activeIndex,
79
+ container,
80
+ measure,
81
+ order
82
+ ]);
83
+ return {
84
+ /** The measured row, once mounted. */
85
+ container,
86
+ containerRef: setContainer,
87
+ /** Whether the row has been measured; until then every item shows. */
88
+ measured,
89
+ measureRef: setMeasure,
90
+ visibleCount: Math.min(visibleCount, itemCount)
91
+ };
92
+ };
93
+ export { INLINE_OVERFLOW_ITEM_ATTRIBUTE, INLINE_OVERFLOW_TRIGGER_ATTRIBUTE, useInlineOverflow };
package/dist/icons.d.ts CHANGED
@@ -25,6 +25,6 @@
25
25
  * Only ESM named re-exports live here, and the package marks nothing but its
26
26
  * CSS as having side effects, so a bundler keeps just the glyphs a page uses.
27
27
  */
28
- import { AccessibilityIcon, ActivityIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, AppWindowMacIcon as BrowserControlIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookOpenIcon as CaseLawIcon, BookOpenIcon as SkillIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyIcon as CopyFromMenuIcon, CopyIcon as CopyToClipboardIcon, CopyIcon as DuplicateIcon, CopyPlusIcon, CornerDownLeftIcon, CornerDownRightIcon as FollowUpIcon, CpuIcon, CropIcon, DatabaseIcon, DollarSignIcon, DownloadIcon, EditIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileStackIcon as EditPagesIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, LucideIcon, LucideIcon as LucideIcon$1, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquarePlusIcon as NewChatIcon, MessageSquareQuoteIcon as AddCommentIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, MicIcon as DictateIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WandSparklesIcon as AiActionIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon } from "lucide-react";
28
+ import { AccessibilityIcon, ActivityIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, AppWindowMacIcon as BrowserControlIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookOpenIcon as CaseLawIcon, BookOpenIcon as SkillIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyIcon as CopyFromMenuIcon, CopyIcon as CopyToClipboardIcon, CopyIcon as DuplicateIcon, CopyPlusIcon, CornerDownLeftIcon, CornerDownRightIcon as FollowUpIcon, CpuIcon, CropIcon, DatabaseIcon, DollarSignIcon, DownloadIcon, EditIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileStackIcon as EditPagesIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, LucideIcon, LucideIcon as LucideIcon$1, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquarePlusIcon as NewChatIcon, MessageSquareQuoteIcon as AddCommentIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, MicIcon as DictateIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SlashIcon, SlidersHorizontalIcon, SmartphoneIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TabletIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WandSparklesIcon as AiActionIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon } from "lucide-react";
29
29
  export declare const MoveToSideIcon: LucideIcon$1;
30
- export { AccessibilityIcon, ActivityIcon, AddCommentIcon, AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CaseLawIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyFromMenuIcon, CopyPlusIcon, CopyToClipboardIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, DictateIcon, DollarSignIcon, DownloadIcon, DuplicateIcon, EditIcon, EditPagesIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FollowUpIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, type LucideIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, NewChatIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SkillIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon };
30
+ export { AccessibilityIcon, ActivityIcon, AddCommentIcon, AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CaseLawIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyFromMenuIcon, CopyPlusIcon, CopyToClipboardIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, DictateIcon, DollarSignIcon, DownloadIcon, DuplicateIcon, EditIcon, EditPagesIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FollowUpIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, type LucideIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, NewChatIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SkillIcon, SlashIcon, SlidersHorizontalIcon, SmartphoneIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TabletIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon };
package/dist/icons.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AccessibilityIcon, ActivityIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, AppWindowMacIcon as BrowserControlIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookOpenIcon as CaseLawIcon, BookOpenIcon as SkillIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyIcon as CopyFromMenuIcon, CopyIcon as CopyToClipboardIcon, CopyIcon as DuplicateIcon, CopyPlusIcon, CornerDownLeftIcon, CornerDownRightIcon as FollowUpIcon, CpuIcon, CropIcon, DatabaseIcon, DollarSignIcon, DownloadIcon, EditIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileStackIcon as EditPagesIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquarePlusIcon as NewChatIcon, MessageSquareQuoteIcon as AddCommentIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, MicIcon as DictateIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WandSparklesIcon as AiActionIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon, createLucideIcon } from "lucide-react";
1
+ import { AccessibilityIcon, ActivityIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, AppWindowMacIcon as BrowserControlIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookOpenIcon as CaseLawIcon, BookOpenIcon as SkillIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyIcon as CopyFromMenuIcon, CopyIcon as CopyToClipboardIcon, CopyIcon as DuplicateIcon, CopyPlusIcon, CornerDownLeftIcon, CornerDownRightIcon as FollowUpIcon, CpuIcon, CropIcon, DatabaseIcon, DollarSignIcon, DownloadIcon, EditIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileStackIcon as EditPagesIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquarePlusIcon as NewChatIcon, MessageSquareQuoteIcon as AddCommentIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, MicIcon as DictateIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SlashIcon, SlidersHorizontalIcon, SmartphoneIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TabletIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WandSparklesIcon as AiActionIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon, createLucideIcon } from "lucide-react";
2
2
  // src/icons.ts
3
3
  /**
4
4
  * Every icon Stella draws, from one module (`@stll/ui/icons`).
@@ -52,4 +52,4 @@ const MoveToSideIcon = /* @__PURE__ */ createLucideIcon("move-to-side", [
52
52
  key: "move-to-side-chevron"
53
53
  }]
54
54
  ]);
55
- export { AccessibilityIcon, ActivityIcon, AddCommentIcon, AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CaseLawIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyFromMenuIcon, CopyPlusIcon, CopyToClipboardIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, DictateIcon, DollarSignIcon, DownloadIcon, DuplicateIcon, EditIcon, EditPagesIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FollowUpIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveToSideIcon, NewChatIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SkillIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon };
55
+ export { AccessibilityIcon, ActivityIcon, AddCommentIcon, AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CaseLawIcon, ChartColumnIcon, ChartLineIcon, ChartNoAxesColumnIcon, ChartPieIcon, ChartScatterIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyFromMenuIcon, CopyPlusIcon, CopyToClipboardIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, DictateIcon, DollarSignIcon, DownloadIcon, DuplicateIcon, EditIcon, EditPagesIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FollowUpIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveToSideIcon, NewChatIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SkillIcon, SlashIcon, SlidersHorizontalIcon, SmartphoneIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TabletIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon };
@@ -38,6 +38,6 @@ export type InspectorFacetBarProps<F extends string> = {
38
38
  * (`˅`) dropdown. The active facet is pinned visible ahead of the rest
39
39
  * so the current tab stays readable rather than hiding inside the menu
40
40
  * — except at the narrowest widths, where not even the active chip fits
41
- * beside the trigger; see `resolveFacetOverflow`'s narrow-width floor.
41
+ * beside the trigger; see `resolveInlineOverflow`'s narrow-width floor.
42
42
  */
43
43
  export declare const InspectorFacetBar: <F extends string>({ facet, facets, labels, disabledFacets, pulseSeq, activeBadge, overflowMenuLabel, onChange }: InspectorFacetBarProps<F>) => import("react").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import { Button } from "../components/button.js";
2
2
  import { DropdownMenu as Menu, DropdownMenuContent as MenuPopup, DropdownMenuItem as MenuItem, DropdownMenuTrigger as MenuTrigger } from "../components/menu.js";
3
3
  import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "../components/tooltip.js";
4
+ import { INLINE_OVERFLOW_ITEM_ATTRIBUTE, INLINE_OVERFLOW_TRIGGER_ATTRIBUTE, useInlineOverflow } from "../hooks/use-inline-overflow.js";
4
5
  import { ChevronDownIcon } from "../icons.js";
6
+ import { splitInlineOverflow } from "../lib/inline-overflow.js";
5
7
  import { cn } from "../lib/utils.js";
6
- import { resolveFacetOverflow } from "./facet-bar.logic.js";
7
8
  import { TOOLBAR_ROW_HEIGHT } from "./layout-tokens.js";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { useEffect, useRef, useState } from "react";
10
+ import { useEffect, useRef } from "react";
10
11
  // src/inspector/facet-bar.tsx
11
12
  /**
12
13
  * Inspector subtab row: a single line of pill chips at toolbar-row
@@ -20,63 +21,23 @@ import { useEffect, useRef, useState } from "react";
20
21
  * (`˅`) dropdown. The active facet is pinned visible ahead of the rest
21
22
  * so the current tab stays readable rather than hiding inside the menu
22
23
  * — except at the narrowest widths, where not even the active chip fits
23
- * beside the trigger; see `resolveFacetOverflow`'s narrow-width floor.
24
+ * beside the trigger; see `resolveInlineOverflow`'s narrow-width floor.
24
25
  */
25
26
  const InspectorFacetBar = ({ facet, facets, labels, disabledFacets, pulseSeq, activeBadge, overflowMenuLabel, onChange }) => {
26
27
  const lastPulseSeq = useRef(pulseSeq);
27
- const containerRef = useRef(null);
28
- const measureRef = useRef(null);
29
- const [visibleCount, setVisibleCount] = useState(facets.length);
28
+ const activeIndex = facets.indexOf(facet);
29
+ const { container, containerRef, measureRef, visibleCount } = useInlineOverflow({
30
+ activeIndex,
31
+ itemKeys: facets
32
+ });
33
+ const { visible: visibleFacets, overflow: overflowFacets } = splitInlineOverflow(facets, visibleCount, activeIndex);
34
+ const overflowing = overflowFacets.length > 0;
30
35
  useEffect(() => {
31
36
  if (pulseSeq === void 0 || pulseSeq === lastPulseSeq.current) return;
32
37
  lastPulseSeq.current = pulseSeq;
33
- const activeChip = containerRef.current?.querySelector("[data-facet-chip-active]");
38
+ const activeChip = container?.querySelector("[data-facet-chip-active]");
34
39
  if (activeChip instanceof HTMLElement) flashFacetChip(activeChip);
35
- }, [pulseSeq]);
36
- useEffect(() => {
37
- const container = containerRef.current;
38
- const measure = measureRef.current;
39
- if (!container || !measure) return;
40
- const recompute = () => {
41
- const style = getComputedStyle(container);
42
- const padX = (Number.parseFloat(style.paddingInlineStart) || 0) + (Number.parseFloat(style.paddingInlineEnd) || 0);
43
- const gap = Number.parseFloat(style.columnGap) || 0;
44
- const availableWidth = container.clientWidth - padX;
45
- const cells = [...measure.children];
46
- const triggerWidth = cells.at(-1)?.getBoundingClientRect().width ?? 0;
47
- const chipWidths = cells.slice(0, facets.length).map((cell) => cell.getBoundingClientRect().width);
48
- const policy = resolveFacetOverflow({
49
- activeIndex: facets.indexOf(facet),
50
- availableWidth,
51
- chipWidths,
52
- gap,
53
- triggerWidth
54
- });
55
- setVisibleCount(policy.visibleCount);
56
- };
57
- const observer = new ResizeObserver(recompute);
58
- observer.observe(container);
59
- observer.observe(measure);
60
- recompute();
61
- return () => observer.disconnect();
62
- }, [facets, facet]);
63
- const overflowing = visibleCount < facets.length;
64
- const activeIndex = facets.indexOf(facet);
65
- let visibleFacets;
66
- let overflowFacets;
67
- if (!overflowing) {
68
- visibleFacets = [...facets];
69
- overflowFacets = [];
70
- } else if (visibleCount === 0) {
71
- visibleFacets = [];
72
- overflowFacets = [...facets];
73
- } else if (activeIndex < visibleCount) {
74
- visibleFacets = facets.slice(0, visibleCount);
75
- overflowFacets = facets.slice(visibleCount);
76
- } else {
77
- visibleFacets = [...facets.slice(0, visibleCount - 1), facet];
78
- overflowFacets = facets.filter((value) => !visibleFacets.includes(value));
79
- }
40
+ }, [container, pulseSeq]);
80
41
  return /* @__PURE__ */ jsxs("div", {
81
42
  className: cn("bg-background/85 supports-[backdrop-filter]:bg-background/65 sticky top-0 z-10 flex shrink-0 items-center gap-0.5 overflow-hidden border-b px-1.5 backdrop-blur", TOOLBAR_ROW_HEIGHT),
82
43
  "data-active-facet": facet,
@@ -123,8 +84,12 @@ const InspectorFacetBar = ({ facet, facets, labels, disabledFacets, pulseSeq, ac
123
84
  className: cn(CHIP_CLASS, INACTIVE_CHIP_CLASS),
124
85
  "data-facet-option": value,
125
86
  "data-facet-option-disabled": disabledFacets?.has(value) ? "" : void 0,
87
+ [INLINE_OVERFLOW_ITEM_ATTRIBUTE]: value,
126
88
  children: labels[value]
127
- }, value)), /* @__PURE__ */ jsx("span", { className: "size-8 shrink-0 rounded-lg border sm:size-7" })]
89
+ }, value)), /* @__PURE__ */ jsx("span", {
90
+ className: "size-8 shrink-0 rounded-lg border sm:size-7",
91
+ [INLINE_OVERFLOW_TRIGGER_ATTRIBUTE]: ""
92
+ })]
128
93
  })
129
94
  ]
130
95
  });
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The overflow policy of a single-line row of items (tabs, chips) that
3
+ * collapses the items that do not fit into a trailing "show more" menu.
4
+ * The inspector facet bar and the saved-view strip both run it, so the two
5
+ * rows decide alike which items stay on screen. Pure, so it is tested
6
+ * without a DOM or a `ResizeObserver`; `useInlineOverflow` measures a row
7
+ * and feeds it.
8
+ */
9
+ export type InlineOverflowInput = {
10
+ /** Width inside the row available to the items (the trigger's own
11
+ * footprint is reserved out of this by the policy, not by the caller). */
12
+ availableWidth: number;
13
+ /** Each item's natural (measured) width, in display order. */
14
+ itemWidths: readonly number[];
15
+ /** Index into `itemWidths` of the active item, always kept visible
16
+ * whenever anything is. */
17
+ activeIndex: number;
18
+ /** The overflow trigger's own footprint, reserved alongside the items
19
+ * whenever not every item fits. */
20
+ triggerWidth: number;
21
+ /** Horizontal gap between adjacent items, and between the last item and
22
+ * the trigger. */
23
+ gap?: number;
24
+ };
25
+ export type InlineOverflowPolicy = {
26
+ /** How many items are visible. Counts a prefix of `itemWidths` in their
27
+ * given order when the active item already falls inside that prefix;
28
+ * otherwise counts the active item plus however many others (in order,
29
+ * skipping the active one) fit alongside it. `0` is the narrow-width
30
+ * floor: not even the active item fits, so nothing but the trigger
31
+ * shows. */
32
+ visibleCount: number;
33
+ /** Whether the overflow trigger renders at all. */
34
+ showOverflowTrigger: boolean;
35
+ };
36
+ /**
37
+ * Decides the row's visible/overflow split.
38
+ *
39
+ * Narrow-width floor: if even the active item cannot fit beside the
40
+ * trigger, showing it anyway would push the trigger past
41
+ * `availableWidth`; the row clips overflow, so the trigger (the only way
42
+ * to reach ANY item from this row) would become unreachable. Rather than
43
+ * shrink the active item below its natural width (this policy has no
44
+ * minimum-width input to shrink to), this drops the active item from the
45
+ * visible row too and shows only the trigger: every item, including the
46
+ * active one, still reaches through the overflow menu, and the trigger
47
+ * itself always stays on screen.
48
+ */
49
+ export declare const resolveInlineOverflow: ({ availableWidth, itemWidths, activeIndex, triggerWidth, gap }: InlineOverflowInput) => InlineOverflowPolicy;
50
+ export type InlineOverflowSplit<T> = {
51
+ /** The items the row shows, in display order. */
52
+ visible: T[];
53
+ /** The items the overflow menu lists, in display order. */
54
+ overflow: T[];
55
+ };
56
+ /**
57
+ * Splits `items` the way `resolveInlineOverflow` counted them: a prefix of
58
+ * `visibleCount` items when the active one is inside it, else the first
59
+ * `visibleCount - 1` items and the active one after them. Every item lands
60
+ * in exactly one of the two lists, each in its original order.
61
+ */
62
+ export declare const splitInlineOverflow: <T>(items: readonly T[], visibleCount: number, activeIndex: number) => InlineOverflowSplit<T>;
@@ -0,0 +1,79 @@
1
+ // src/lib/inline-overflow.ts
2
+ const sumWithGaps = (widths, gap) => widths.reduce((sum, width, index) => sum + width + (index > 0 ? gap : 0), 0);
3
+ /**
4
+ * Decides the row's visible/overflow split.
5
+ *
6
+ * Narrow-width floor: if even the active item cannot fit beside the
7
+ * trigger, showing it anyway would push the trigger past
8
+ * `availableWidth`; the row clips overflow, so the trigger (the only way
9
+ * to reach ANY item from this row) would become unreachable. Rather than
10
+ * shrink the active item below its natural width (this policy has no
11
+ * minimum-width input to shrink to), this drops the active item from the
12
+ * visible row too and shows only the trigger: every item, including the
13
+ * active one, still reaches through the overflow menu, and the trigger
14
+ * itself always stays on screen.
15
+ */
16
+ const resolveInlineOverflow = ({ availableWidth, itemWidths, activeIndex, triggerWidth, gap = 0 }) => {
17
+ if (sumWithGaps(itemWidths, gap) <= availableWidth) return {
18
+ visibleCount: itemWidths.length,
19
+ showOverflowTrigger: false
20
+ };
21
+ let used = 0;
22
+ let count = 0;
23
+ for (const width of itemWidths) {
24
+ const add = width + (count > 0 ? gap : 0);
25
+ if (used + add + gap + triggerWidth > availableWidth) break;
26
+ used += add;
27
+ count += 1;
28
+ }
29
+ if (activeIndex < count) return {
30
+ visibleCount: count,
31
+ showOverflowTrigger: true
32
+ };
33
+ const activeWidth = itemWidths[activeIndex] ?? 0;
34
+ if (activeWidth + gap + triggerWidth > availableWidth) return {
35
+ visibleCount: 0,
36
+ showOverflowTrigger: true
37
+ };
38
+ used = activeWidth;
39
+ count = 0;
40
+ for (const [index, width] of itemWidths.entries()) {
41
+ if (index === activeIndex) continue;
42
+ const add = width + gap;
43
+ if (used + add + gap + triggerWidth > availableWidth) break;
44
+ used += add;
45
+ count += 1;
46
+ }
47
+ return {
48
+ visibleCount: count + 1,
49
+ showOverflowTrigger: true
50
+ };
51
+ };
52
+ /**
53
+ * Splits `items` the way `resolveInlineOverflow` counted them: a prefix of
54
+ * `visibleCount` items when the active one is inside it, else the first
55
+ * `visibleCount - 1` items and the active one after them. Every item lands
56
+ * in exactly one of the two lists, each in its original order.
57
+ */
58
+ const splitInlineOverflow = (items, visibleCount, activeIndex) => {
59
+ const count = Math.max(0, Math.min(visibleCount, items.length));
60
+ if (count === items.length) return {
61
+ visible: [...items],
62
+ overflow: []
63
+ };
64
+ if (count === 0) return {
65
+ visible: [],
66
+ overflow: [...items]
67
+ };
68
+ if (activeIndex < count) return {
69
+ visible: items.slice(0, count),
70
+ overflow: items.slice(count)
71
+ };
72
+ const shown = new Set(Array.from({ length: count - 1 }, (_, index) => index));
73
+ shown.add(activeIndex);
74
+ return {
75
+ visible: items.filter((_, index) => shown.has(index)),
76
+ overflow: items.filter((_, index) => !shown.has(index))
77
+ };
78
+ };
79
+ export { resolveInlineOverflow, splitInlineOverflow };
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from "react";
2
- export declare const MATTER_SWATCHES: readonly ["--option-blue", "--option-emerald", "--option-amber", "--option-violet", "--option-red", "--option-cyan", "--option-orange", "--option-teal"];
3
- export declare const getMatterSwatch: (id: string) => "--option-amber" | "--option-blue" | "--option-cyan" | "--option-emerald" | "--option-orange" | "--option-red" | "--option-teal" | "--option-violet";
2
+ export declare const MATTER_SWATCHES: readonly ["--option-blue", "--option-emerald", "--option-amber", "--option-violet", "--option-cyan", "--option-orange", "--option-teal"];
3
+ export declare const getMatterSwatch: (id: string) => "--option-amber" | "--option-blue" | "--option-cyan" | "--option-emerald" | "--option-orange" | "--option-teal" | "--option-violet";
4
4
  export declare const getMatterColor: (id: string) => string;
5
5
  export declare const getMatterPickerColor: (id: string, color: string | null) => string;
6
6
  export declare const toStoredMatterColor: (color: string) => string;
@@ -6,7 +6,6 @@ const MATTER_SWATCHES = [
6
6
  "--option-emerald",
7
7
  "--option-amber",
8
8
  "--option-violet",
9
- "--option-red",
10
9
  "--option-cyan",
11
10
  "--option-orange",
12
11
  "--option-teal"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/ui",
3
- "version": "0.80.0",
3
+ "version": "0.81.0",
4
4
  "description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
5
5
  "keywords": [
6
6
  "base-ui",
@@ -270,6 +270,10 @@
270
270
  "types": "./dist/components/input.d.ts",
271
271
  "import": "./dist/components/input.js"
272
272
  },
273
+ "./inline-overflow": {
274
+ "types": "./dist/lib/inline-overflow.d.ts",
275
+ "import": "./dist/lib/inline-overflow.js"
276
+ },
273
277
  "./inline-rename": {
274
278
  "types": "./dist/components/inline-rename.d.ts",
275
279
  "import": "./dist/components/inline-rename.js"
@@ -634,6 +638,10 @@
634
638
  "types": "./dist/hooks/use-content-dir.d.ts",
635
639
  "import": "./dist/hooks/use-content-dir.js"
636
640
  },
641
+ "./use-inline-overflow": {
642
+ "types": "./dist/hooks/use-inline-overflow.d.ts",
643
+ "import": "./dist/hooks/use-inline-overflow.js"
644
+ },
637
645
  "./use-latest": {
638
646
  "types": "./dist/hooks/use-latest.d.ts",
639
647
  "import": "./dist/hooks/use-latest.js"
@@ -1,48 +0,0 @@
1
- /**
2
- * Pure overflow policy for `InspectorFacetBar`: given the row's available
3
- * width and each chip's natural (measured) width, decides how many chips
4
- * stay visible and whether the overflow trigger renders — kept out of the
5
- * component so it's unit-testable without a DOM or a `ResizeObserver`.
6
- */
7
- export type FacetOverflowInput = {
8
- /** Width inside the row available to the chips (the trigger's own
9
- * footprint is reserved out of this by the policy, not by the caller). */
10
- availableWidth: number;
11
- /** Each chip's natural width, in the same order as the facets they
12
- * represent. */
13
- chipWidths: readonly number[];
14
- /** Index into `chipWidths` of the active chip — always kept visible
15
- * whenever anything is. */
16
- activeIndex: number;
17
- /** The overflow trigger's own footprint, reserved alongside the chips
18
- * whenever not every chip fits. */
19
- triggerWidth: number;
20
- /** Horizontal gap between adjacent chips, and between the last chip and
21
- * the trigger. */
22
- gap?: number;
23
- };
24
- export type FacetOverflowPolicy = {
25
- /** How many chips are visible. Counts a prefix of `chipWidths` in their
26
- * given order when the active chip already falls inside that prefix;
27
- * otherwise counts the active chip plus however many others (in order,
28
- * skipping the active one) fit alongside it. `0` is the narrow-width
29
- * floor: not even the active chip fits, so nothing but the trigger
30
- * shows. */
31
- visibleCount: number;
32
- /** Whether the overflow trigger renders at all. */
33
- showOverflowTrigger: boolean;
34
- };
35
- /**
36
- * Decides the facet row's visible/overflow split.
37
- *
38
- * Narrow-width floor: if even the active chip cannot fit beside the
39
- * trigger, showing it anyway would push the trigger past
40
- * `availableWidth` — the row clips overflow, so the trigger (the only way
41
- * to reach ANY facet from this row) would become unreachable. Rather than
42
- * shrink the active chip below its natural width (this policy has no
43
- * minimum-width input to shrink to), this drops the active chip from the
44
- * visible row too and shows only the trigger: every facet, including the
45
- * active one, still reaches through the overflow menu, and the trigger
46
- * itself always stays on screen.
47
- */
48
- export declare const resolveFacetOverflow: ({ availableWidth, chipWidths, activeIndex, triggerWidth, gap }: FacetOverflowInput) => FacetOverflowPolicy;
@@ -1,52 +0,0 @@
1
- // src/inspector/facet-bar.logic.ts
2
- const sumWithGaps = (widths, gap) => widths.reduce((sum, width, index) => sum + width + (index > 0 ? gap : 0), 0);
3
- /**
4
- * Decides the facet row's visible/overflow split.
5
- *
6
- * Narrow-width floor: if even the active chip cannot fit beside the
7
- * trigger, showing it anyway would push the trigger past
8
- * `availableWidth` — the row clips overflow, so the trigger (the only way
9
- * to reach ANY facet from this row) would become unreachable. Rather than
10
- * shrink the active chip below its natural width (this policy has no
11
- * minimum-width input to shrink to), this drops the active chip from the
12
- * visible row too and shows only the trigger: every facet, including the
13
- * active one, still reaches through the overflow menu, and the trigger
14
- * itself always stays on screen.
15
- */
16
- const resolveFacetOverflow = ({ availableWidth, chipWidths, activeIndex, triggerWidth, gap = 0 }) => {
17
- if (sumWithGaps(chipWidths, gap) <= availableWidth) return {
18
- visibleCount: chipWidths.length,
19
- showOverflowTrigger: false
20
- };
21
- let used = 0;
22
- let count = 0;
23
- for (const width of chipWidths) {
24
- const add = width + (count > 0 ? gap : 0);
25
- if (used + add + gap + triggerWidth > availableWidth) break;
26
- used += add;
27
- count += 1;
28
- }
29
- if (activeIndex < count) return {
30
- visibleCount: count,
31
- showOverflowTrigger: true
32
- };
33
- const activeWidth = chipWidths[activeIndex] ?? 0;
34
- if (activeWidth + gap + triggerWidth > availableWidth) return {
35
- visibleCount: 0,
36
- showOverflowTrigger: true
37
- };
38
- used = activeWidth;
39
- count = 0;
40
- for (const [index, width] of chipWidths.entries()) {
41
- if (index === activeIndex) continue;
42
- const add = width + gap;
43
- if (used + add + gap + triggerWidth > availableWidth) break;
44
- used += add;
45
- count += 1;
46
- }
47
- return {
48
- visibleCount: count + 1,
49
- showOverflowTrigger: true
50
- };
51
- };
52
- export { resolveFacetOverflow };