@stll/ui 0.80.0 → 0.81.1
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/calendar/day-calendar.d.ts +6 -1
- package/dist/calendar/day-calendar.js +77 -20
- package/dist/components/animated-count.js +5 -5
- package/dist/components/document-mark.shared.d.ts +14 -125
- package/dist/components/document-mark.shared.js +222 -37
- package/dist/components/hex-color-picker.js +10 -11
- package/dist/components/swap-text.js +9 -7
- package/dist/hooks/use-inline-overflow.d.ts +52 -0
- package/dist/hooks/use-inline-overflow.js +95 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +2 -2
- package/dist/inspector/facet-bar.d.ts +1 -1
- package/dist/inspector/facet-bar.js +68 -99
- package/dist/lib/file-size.d.ts +6 -2
- package/dist/lib/file-size.js +6 -2
- package/dist/lib/inline-overflow.d.ts +62 -0
- package/dist/lib/inline-overflow.js +79 -0
- package/dist/lib/matter-colors.d.ts +2 -2
- package/dist/lib/matter-colors.js +0 -1
- package/package.json +9 -1
- package/dist/inspector/facet-bar.logic.d.ts +0 -48
- package/dist/inspector/facet-bar.logic.js +0 -52
|
@@ -0,0 +1,52 @@
|
|
|
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 box is the room the items and the
|
|
22
|
+
* overflow trigger share, independent of how many items it shows. It
|
|
23
|
+
* carries no inline padding or border of its own (an inset belongs on a
|
|
24
|
+
* wrapper), so its client rect is that room, in the copies' own units;
|
|
25
|
+
* - an invisible, inert copy of every item at its natural width plus the
|
|
26
|
+
* trigger (`measureRef`), each marked with `INLINE_OVERFLOW_ITEM_ATTRIBUTE`
|
|
27
|
+
* (set to the item's key) or `INLINE_OVERFLOW_TRIGGER_ATTRIBUTE`, inside
|
|
28
|
+
* one flex row whose gap is the gap between items.
|
|
29
|
+
*
|
|
30
|
+
* Measuring the copy keeps the widths stable however many items the row is
|
|
31
|
+
* currently showing, so collapsing an item never changes the measurement
|
|
32
|
+
* that collapsed it. Widths are read by key in the order `itemKeys` gives,
|
|
33
|
+
* and the count is recomputed whenever either element resizes (a docked
|
|
34
|
+
* pane narrows the row, an added view or a rename widens the copy), the
|
|
35
|
+
* active item changes, or the items change order: swapping two items keeps
|
|
36
|
+
* the measuring row's size, which no observer reports.
|
|
37
|
+
*
|
|
38
|
+
* The first count is taken in a layout effect, in the same task that commits
|
|
39
|
+
* the row: a `ResizeObserver` reports only at the browser's next rendering
|
|
40
|
+
* update, and until that count lands the row would hold every item, the last
|
|
41
|
+
* ones clipped, for a paint or any script that reads the layout to see.
|
|
42
|
+
*/
|
|
43
|
+
export declare const useInlineOverflow: ({ activeIndex, itemKeys }: UseInlineOverflowOptions) => {
|
|
44
|
+
/** The measured row, once mounted. */
|
|
45
|
+
container: HTMLElement | null;
|
|
46
|
+
containerRef: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
|
|
47
|
+
/** Whether the row has been measured; until then every item shows. */
|
|
48
|
+
measured: boolean;
|
|
49
|
+
measureRef: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
|
|
50
|
+
visibleCount: number;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { resolveInlineOverflow } from "../lib/inline-overflow.js";
|
|
2
|
+
import { useLayoutEffect, 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 box is the room the items and the
|
|
27
|
+
* overflow trigger share, independent of how many items it shows. It
|
|
28
|
+
* carries no inline padding or border of its own (an inset belongs on a
|
|
29
|
+
* wrapper), so its client rect is that room, in the copies' own units;
|
|
30
|
+
* - an invisible, inert copy of every item at its natural width plus the
|
|
31
|
+
* trigger (`measureRef`), each marked with `INLINE_OVERFLOW_ITEM_ATTRIBUTE`
|
|
32
|
+
* (set to the item's key) or `INLINE_OVERFLOW_TRIGGER_ATTRIBUTE`, inside
|
|
33
|
+
* one flex row whose gap is the gap between items.
|
|
34
|
+
*
|
|
35
|
+
* Measuring the copy keeps the widths stable however many items the row is
|
|
36
|
+
* currently showing, so collapsing an item never changes the measurement
|
|
37
|
+
* that collapsed it. Widths are read by key in the order `itemKeys` gives,
|
|
38
|
+
* and the count is recomputed whenever either element resizes (a docked
|
|
39
|
+
* pane narrows the row, an added view or a rename widens the copy), the
|
|
40
|
+
* active item changes, or the items change order: swapping two items keeps
|
|
41
|
+
* the measuring row's size, which no observer reports.
|
|
42
|
+
*
|
|
43
|
+
* The first count is taken in a layout effect, in the same task that commits
|
|
44
|
+
* the row: a `ResizeObserver` reports only at the browser's next rendering
|
|
45
|
+
* update, and until that count lands the row would hold every item, the last
|
|
46
|
+
* ones clipped, for a paint or any script that reads the layout to see.
|
|
47
|
+
*/
|
|
48
|
+
const useInlineOverflow = ({ activeIndex, itemKeys }) => {
|
|
49
|
+
const itemCount = itemKeys.length;
|
|
50
|
+
const order = itemKeys.join(KEY_SEPARATOR);
|
|
51
|
+
const [container, setContainer] = useState(null);
|
|
52
|
+
const [measure, setMeasure] = useState(null);
|
|
53
|
+
const [visibleCount, setVisibleCount] = useState(itemCount);
|
|
54
|
+
const [measured, setMeasured] = useState(false);
|
|
55
|
+
useLayoutEffect(() => {
|
|
56
|
+
if (!container || !measure) return;
|
|
57
|
+
const keys = order === "" ? [] : order.split(KEY_SEPARATOR);
|
|
58
|
+
const recompute = () => {
|
|
59
|
+
const copies = Array.from(measure.querySelectorAll(`[${INLINE_OVERFLOW_ITEM_ATTRIBUTE}]`), (copy) => ({
|
|
60
|
+
key: copy.getAttribute(INLINE_OVERFLOW_ITEM_ATTRIBUTE),
|
|
61
|
+
box: copy.getBoundingClientRect()
|
|
62
|
+
}));
|
|
63
|
+
const boxByKey = new Map(copies.map(({ key, box }) => [key, box]));
|
|
64
|
+
const trigger = measure.querySelector(`[${INLINE_OVERFLOW_TRIGGER_ATTRIBUTE}]`);
|
|
65
|
+
setVisibleCount(resolveInlineOverflow({
|
|
66
|
+
activeIndex,
|
|
67
|
+
availableWidth: container.getBoundingClientRect().width,
|
|
68
|
+
gap: itemGap(copies.map(({ box }) => box)),
|
|
69
|
+
itemWidths: keys.map((key) => boxByKey.get(key)?.width ?? 0),
|
|
70
|
+
triggerWidth: trigger?.getBoundingClientRect().width ?? 0
|
|
71
|
+
}).visibleCount);
|
|
72
|
+
setMeasured(true);
|
|
73
|
+
};
|
|
74
|
+
recompute();
|
|
75
|
+
const observer = new ResizeObserver(recompute);
|
|
76
|
+
observer.observe(container);
|
|
77
|
+
observer.observe(measure);
|
|
78
|
+
return () => observer.disconnect();
|
|
79
|
+
}, [
|
|
80
|
+
activeIndex,
|
|
81
|
+
container,
|
|
82
|
+
measure,
|
|
83
|
+
order
|
|
84
|
+
]);
|
|
85
|
+
return {
|
|
86
|
+
/** The measured row, once mounted. */
|
|
87
|
+
container,
|
|
88
|
+
containerRef: setContainer,
|
|
89
|
+
/** Whether the row has been measured; until then every item shows. */
|
|
90
|
+
measured,
|
|
91
|
+
measureRef: setMeasure,
|
|
92
|
+
visibleCount: Math.min(visibleCount, itemCount)
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
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 `
|
|
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
|
|
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,113 +21,81 @@ 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 `
|
|
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
|
|
28
|
-
const measureRef =
|
|
29
|
-
|
|
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 =
|
|
38
|
+
const activeChip = container?.querySelector("[data-facet-chip-active]");
|
|
34
39
|
if (activeChip instanceof HTMLElement) flashFacetChip(activeChip);
|
|
35
|
-
}, [pulseSeq]);
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
}
|
|
80
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
81
|
-
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),
|
|
40
|
+
}, [container, pulseSeq]);
|
|
41
|
+
return /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: cn("bg-background/85 supports-[backdrop-filter]:bg-background/65 sticky top-0 z-10 flex shrink-0 items-center overflow-hidden border-b px-1.5 backdrop-blur", TOOLBAR_ROW_HEIGHT),
|
|
82
43
|
"data-active-facet": facet,
|
|
83
44
|
"data-slot": "inspector-facet-bar",
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
className: "ms-auto",
|
|
101
|
-
"data-slot": "inspector-facet-overflow-trigger",
|
|
102
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
103
|
-
size: "icon-sm",
|
|
104
|
-
type: "button",
|
|
105
|
-
variant: "outline"
|
|
45
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "relative flex h-full min-w-0 flex-1 items-center gap-0.5",
|
|
47
|
+
"data-slot": "inspector-facet-row",
|
|
48
|
+
ref: containerRef,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "contents",
|
|
52
|
+
role: "tablist",
|
|
53
|
+
children: visibleFacets.map((value) => /* @__PURE__ */ jsx(FacetChip, {
|
|
54
|
+
activeBadge,
|
|
55
|
+
disabled: disabledFacets?.has(value) ?? false,
|
|
56
|
+
isActive: value === facet,
|
|
57
|
+
label: labels[value],
|
|
58
|
+
onSelect: () => onChange(value),
|
|
59
|
+
value
|
|
60
|
+
}, value))
|
|
106
61
|
}),
|
|
107
|
-
children: /* @__PURE__ */ jsx(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
62
|
+
overflowing && /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
63
|
+
"aria-label": overflowMenuLabel,
|
|
64
|
+
className: "ms-auto",
|
|
65
|
+
"data-slot": "inspector-facet-overflow-trigger",
|
|
66
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
67
|
+
size: "icon-sm",
|
|
68
|
+
type: "button",
|
|
69
|
+
variant: "outline"
|
|
70
|
+
}),
|
|
71
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
72
|
+
}), /* @__PURE__ */ jsx(MenuPopup, {
|
|
73
|
+
align: "end",
|
|
74
|
+
side: "bottom",
|
|
75
|
+
children: overflowFacets.map((value) => /* @__PURE__ */ jsx(MenuItem, {
|
|
76
|
+
"data-facet-overflow-value": value,
|
|
77
|
+
disabled: disabledFacets?.has(value) ?? false,
|
|
78
|
+
onClick: () => onChange(value),
|
|
79
|
+
children: labels[value]
|
|
80
|
+
}, value))
|
|
81
|
+
})] }),
|
|
82
|
+
/* @__PURE__ */ jsxs("div", {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
className: "pointer-events-none invisible absolute flex w-max items-center gap-0.5",
|
|
85
|
+
ref: measureRef,
|
|
86
|
+
children: [facets.map((value) => /* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: cn(CHIP_CLASS, INACTIVE_CHIP_CLASS),
|
|
88
|
+
"data-facet-option": value,
|
|
89
|
+
"data-facet-option-disabled": disabledFacets?.has(value) ? "" : void 0,
|
|
90
|
+
[INLINE_OVERFLOW_ITEM_ATTRIBUTE]: value,
|
|
91
|
+
children: labels[value]
|
|
92
|
+
}, value)), /* @__PURE__ */ jsx("span", {
|
|
93
|
+
className: "size-8 shrink-0 rounded-lg border sm:size-7",
|
|
94
|
+
[INLINE_OVERFLOW_TRIGGER_ATTRIBUTE]: ""
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
130
99
|
});
|
|
131
100
|
};
|
|
132
101
|
/** One-shot attention flash: a ring that appears with a couple of opacity
|
package/dist/lib/file-size.d.ts
CHANGED
|
@@ -8,9 +8,13 @@ type NumberFormatter = {
|
|
|
8
8
|
maximumFractionDigits: number;
|
|
9
9
|
style: "unit";
|
|
10
10
|
unit: string;
|
|
11
|
-
unitDisplay: "short";
|
|
11
|
+
unitDisplay: "long" | "short";
|
|
12
12
|
}) => string;
|
|
13
13
|
};
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* A file size in the reader's locale, at most one decimal ("1.2 MB"). Bytes
|
|
16
|
+
* use the long, plural-aware unit ("333 bytes", "333 bajtů"): the short
|
|
17
|
+
* English unit has no plural ("333 byte").
|
|
18
|
+
*/
|
|
15
19
|
export declare const formatFileSize: (sizeBytes: number, format: NumberFormatter) => string;
|
|
16
20
|
export {};
|
package/dist/lib/file-size.js
CHANGED
|
@@ -17,14 +17,18 @@ const getFileSizeDisplay = (sizeBytes) => {
|
|
|
17
17
|
value: sizeBytes / 1e9
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* A file size in the reader's locale, at most one decimal ("1.2 MB"). Bytes
|
|
22
|
+
* use the long, plural-aware unit ("333 bytes", "333 bajtů"): the short
|
|
23
|
+
* English unit has no plural ("333 byte").
|
|
24
|
+
*/
|
|
21
25
|
const formatFileSize = (sizeBytes, format) => {
|
|
22
26
|
const size = getFileSizeDisplay(sizeBytes);
|
|
23
27
|
return format.number(size.value, {
|
|
24
28
|
maximumFractionDigits: 1,
|
|
25
29
|
style: "unit",
|
|
26
30
|
unit: size.unit,
|
|
27
|
-
unitDisplay: "short"
|
|
31
|
+
unitDisplay: size.unit === "byte" ? "long" : "short"
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
34
|
export { formatFileSize, getFileSizeDisplay };
|
|
@@ -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-
|
|
3
|
-
export declare const getMatterSwatch: (id: string) => "--option-amber" | "--option-blue" | "--option-cyan" | "--option-emerald" | "--option-orange" | "--option-
|
|
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;
|