@qilin-agent/client-ui-primitives 3.1.6 → 3.1.7

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.
@@ -1,34 +1,15 @@
1
1
  /**
2
- * Leading category glyph for clickable artifact links (anchors, file
3
- * mentions, produced-file chips). One component keyed by link category;
4
- * every glyph renders fill="currentColor" and so rides the link's own
5
- * color. Glyphs stay private to this module: the public surface is the
6
- * category vocabulary, not the individual glyph components, so consumers
7
- * cannot compose a glyph outside a link. Design sources:
8
- * ic_globe_language_outline_20, ic_code_outline_20, ic_folder_outline_20,
9
- * ic_photo_outline_20, ic_paper_doc_outline_20, ic_paper_outline_20.
10
- *
11
- * A `url` glyph whose destination names a well-known site is that site's own
12
- * mark instead of the globe (`SiteGlyph.tsx`); every mark keeps the same
13
- * currentColor-only rule.
2
+ * Leading current-color category glyphs for clickable artifact links. The
3
+ * public component keeps individual artwork private to the link vocabulary.
14
4
  */
15
5
  import type { ReactNode } from 'react';
16
6
  import type { IconProps } from './icons/props.ts';
17
- /**
18
- * Link categories with distinct leading glyphs. `url` and `folder` are
19
- * destination categories the consumer states directly; the rest are file
20
- * categories `classifyLinkPath` derives from a path. Code, web, and data
21
- * files share the `code` glyph by design.
22
- */
7
+ /** Link categories with distinct leading glyphs. */
23
8
  export type LinkIconKind = 'url' | 'folder' | 'code' | 'image' | 'document' | 'other';
24
- /** Props for {@link LinkIcon}: the category plus the shared icon sizing seat. */
9
+ /** Props for link icons: the category plus the shared icon sizing seat. */
25
10
  export interface LinkIconProps extends IconProps {
26
11
  kind: LinkIconKind;
27
- /**
28
- * Destination of a `url` link. A well-known site draws its own mark, so
29
- * callers that know the destination should pass it; anything else keeps the
30
- * globe. Other kinds ignore it — their destination is a path, not a site.
31
- */
12
+ /** Destination of a URL link; known HTTP(S) hosts render their site mark. */
32
13
  href?: string | undefined;
33
14
  }
34
15
  /**
@@ -39,11 +20,15 @@ export interface LinkIconProps extends IconProps {
39
20
  */
40
21
  export declare function classifyLinkPath(path: string): LinkIconKind;
41
22
  /**
42
- * Render the leading glyph for one clickable artifact link.
43
- * @param props - The link category, the optional destination that can select a
44
- * site mark, optional size (default 14px — the inline link text size these
45
- * glyphs sit beside), and optional CSS class.
46
- * @returns The category's SVG glyph, riding currentColor.
23
+ * Render a regular one-pixel link icon.
24
+ * @param props - Link category, size, and optional class.
25
+ * @returns The regular decorative link glyph.
26
+ */
27
+ export declare function LinkIconRegular(props: LinkIconProps): ReactNode;
28
+ /**
29
+ * Render a medium 1.3px link icon.
30
+ * @param props - Link category, size, and optional class.
31
+ * @returns The medium decorative link glyph.
47
32
  */
48
- export declare function LinkIcon({ kind, href, size, className }: LinkIconProps): ReactNode;
33
+ export declare function LinkIconMedium(props: LinkIconProps): ReactNode;
49
34
  //# sourceMappingURL=LinkIcon.d.ts.map
@@ -37,6 +37,8 @@ export interface MenuItemButtonProps {
37
37
  shortcut?: MenuItem['shortcut'];
38
38
  /** Leading icon (figma .Menu_cell gap 8). */
39
39
  icon?: ReactNode;
40
+ /** Whether this row identifies the currently displayed page or view. */
41
+ current?: boolean;
40
42
  /** Whether the row cannot be activated. */
41
43
  disabled?: boolean;
42
44
  /** Destructive row: error-colored text/icon and danger hover fill. */
@@ -60,13 +62,14 @@ export interface MenuItemButtonProps {
60
62
  * @param props.children - visible row label.
61
63
  * @param props.shortcut - effective key labels and accessible combination.
62
64
  * @param props.icon - optional leading icon.
65
+ * @param props.current - whether the row identifies the currently displayed page or view.
63
66
  * @param props.disabled - whether the row cannot be activated.
64
67
  * @param props.danger - whether to use the destructive row colors.
65
68
  * @param props.separatorBefore - whether this row starts a new group (hairline above it).
66
69
  * @param props.onSelect - row activation callback.
67
70
  * @returns one menu-item row.
68
71
  */
69
- export declare function MenuItemButton({ children, shortcut, icon, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
72
+ export declare function MenuItemButton({ children, shortcut, icon, current, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
70
73
  /**
71
74
  * Render an anchored dropdown menu. While the list is open its keys mirror the
72
75
  * composer's: Tab settles the focused row — from the trigger, Tab enters the
@@ -102,6 +105,7 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
102
105
  * the trigger (render-prop anchors, effect-positioned proxies — measuring the
103
106
  * wrapper there races the host's layout effects). Called on open, each animation
104
107
  * frame, and scroll/resize; return null to skip placement for that frame.
108
+ * @param props.minWidthFromAnchor - in portal mode, keep the menu at least as wide as its anchor, bounded by viewport margins.
105
109
  * @param props.footer - rows pinned below the scrolling items area, separated
106
110
  * by a hairline; they stay visible while the items above scroll.
107
111
  * @param props.children - component rows rendered after `items` in the same
@@ -118,7 +122,7 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
118
122
  * document.body outside the owner's DOM subtree.
119
123
  * @returns anchor wrapper with the conditional list.
120
124
  */
121
- export declare function Menu({ open, anchor, items, children, selectedId, selectedIds, onSelect, onClose, align, side, portal, closeOnPointerLeave, dense, compact, autoFocus, selection, getAnchorRect, footer, className, listClassName }: {
125
+ export declare function Menu({ open, anchor, items, children, selectedId, selectedIds, onSelect, onClose, align, side, portal, closeOnPointerLeave, dense, compact, autoFocus, selection, getAnchorRect, minWidthFromAnchor, footer, className, listClassName }: {
122
126
  open: boolean;
123
127
  autoFocus?: boolean;
124
128
  anchor: ReactNode;
@@ -137,6 +141,7 @@ export declare function Menu({ open, anchor, items, children, selectedId, select
137
141
  compact?: boolean;
138
142
  selection?: 'check' | 'fill';
139
143
  getAnchorRect?: () => DOMRect | null;
144
+ minWidthFromAnchor?: boolean;
140
145
  className?: string | undefined;
141
146
  listClassName?: string | undefined;
142
147
  }): import("react").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IconProps } from './icons/props.ts';
3
+ /**
4
+ * Render the read-only permission icon with a one-pixel stroke.
5
+ * @param props - Size and optional class.
6
+ * @returns The regular decorative permission glyph.
7
+ */
8
+ export declare function PermissionIconReadOnlyRegular(props: IconProps): ReactNode;
9
+ /**
10
+ * Render the read-only permission icon with a 1.3px stroke.
11
+ * @param props - Size and optional class.
12
+ * @returns The medium decorative permission glyph.
13
+ */
14
+ export declare function PermissionIconReadOnlyMedium(props: IconProps): ReactNode;
15
+ /**
16
+ * Render the workspace-write permission icon with a one-pixel stroke.
17
+ * @param props - Size and optional class.
18
+ * @returns The regular decorative permission glyph.
19
+ */
20
+ export declare function PermissionIconWorkspaceWriteRegular(props: IconProps): ReactNode;
21
+ /**
22
+ * Render the workspace-write permission icon with a 1.3px stroke.
23
+ * @param props - Size and optional class.
24
+ * @returns The medium decorative permission glyph.
25
+ */
26
+ export declare function PermissionIconWorkspaceWriteMedium(props: IconProps): ReactNode;
27
+ /**
28
+ * Render the full-access permission icon with a one-pixel stroke.
29
+ * @param props - Size and optional class.
30
+ * @returns The regular decorative permission glyph.
31
+ */
32
+ export declare function PermissionIconFullAccessRegular(props: IconProps): ReactNode;
33
+ /**
34
+ * Render the full-access permission icon with a 1.3px stroke.
35
+ * @param props - Size and optional class.
36
+ * @returns The medium decorative permission glyph.
37
+ */
38
+ export declare function PermissionIconFullAccessMedium(props: IconProps): ReactNode;
39
+ /**
40
+ * Render the auto-review permission icon with a one-pixel stroke.
41
+ * @param props - Size and optional class.
42
+ * @returns The regular decorative permission glyph.
43
+ */
44
+ export declare function PermissionIconAutoReviewRegular(props: IconProps): ReactNode;
45
+ /**
46
+ * Render the auto-review permission icon with a 1.3px stroke.
47
+ * @param props - Size and optional class.
48
+ * @returns The medium decorative permission glyph.
49
+ */
50
+ export declare function PermissionIconAutoReviewMedium(props: IconProps): ReactNode;
51
+ //# sourceMappingURL=PermissionIcon.d.ts.map
@@ -1,16 +1,21 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { IconProps } from './icons/props.ts';
2
3
  /** Reference domains with distinct composer and transcript glyphs. */
3
4
  export type ReferenceIconKind = 'session' | 'file' | 'folder';
4
5
  /** Props shared by inline reference glyphs. */
5
- export interface ReferenceIconProps {
6
+ export interface ReferenceIconProps extends IconProps {
6
7
  kind: ReferenceIconKind;
7
- size?: number;
8
- className?: string | undefined;
9
8
  }
10
9
  /**
11
- * Render the icon that identifies one inline reference domain.
12
- * @param props - Reference kind, optional size, and optional CSS class.
13
- * @returns The corresponding current-color SVG glyph.
10
+ * Render a regular one-pixel reference icon.
11
+ * @param props - Reference kind, size, and optional class.
12
+ * @returns The regular decorative reference glyph.
14
13
  */
15
- export declare function ReferenceIcon({ kind, size, className }: ReferenceIconProps): ReactNode;
14
+ export declare function ReferenceIconRegular(props: ReferenceIconProps): ReactNode;
15
+ /**
16
+ * Render a medium 1.3px reference icon.
17
+ * @param props - Reference kind, size, and optional class.
18
+ * @returns The medium decorative reference glyph.
19
+ */
20
+ export declare function ReferenceIconMedium(props: ReferenceIconProps): ReactNode;
16
21
  //# sourceMappingURL=ReferenceIcon.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Site marks for well-known external link hosts. {@link LinkIcon} renders one in
2
+ * Site marks for well-known external link hosts. {@link LinkIconMedium} renders one in
3
3
  * the leading glyph seat, so a familiar destination leads with its own mark
4
4
  * instead of the generic globe. The marks are the `simple-icons` artwork set
5
5
  * (CC0-1.0), pinned by this package's dependency on it; each mark takes the
@@ -1,9 +1,10 @@
1
+ /** Anchor-preserving tooltips; an optional body portal escapes clipping containers and stacking contexts that cap the bubble's z-index. */
1
2
  import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
2
- /** Bubble placement relative to the anchor. */
3
- export type TooltipSide = 'right' | 'bottom' | 'top';
3
+ import { type TooltipSide } from './tooltip-placement.ts';
4
+ export type { TooltipSide } from './tooltip-placement.ts';
4
5
  /**
5
- * Suppression channel for enclosing tooltip and hover-card anchors: a visible
6
- * tooltip within an anchor withdraws the enclosing preview while its bubble is shown.
6
+ * Suppression channel for nested tooltips: a visible descendant tooltip
7
+ * withdraws the enclosing tooltip while its bubble is shown.
7
8
  */
8
9
  export declare const TooltipSuppression: import("react").Context<((suppressed: boolean) => void) | null>;
9
10
  /** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
@@ -19,36 +20,45 @@ interface AnchorProps {
19
20
  type TooltipLabel = string | (() => string);
20
21
  /**
21
22
  * Attach a hover/focus tooltip to an anchor element.
22
- * @param props.label - bubble text, or a resolver evaluated only while the bubble is visible.
23
+ * @param props.label - bubble text, or a resolver evaluated only while visible; an empty string shows only shortcut keys.
23
24
  * @param props.shortcutKeys - effective key labels rendered as platform-formatted keycaps after optional text.
24
- * @param props.side - placement relative to the anchor (default 'right').
25
+ * @param props.side - preferred placement (default 'right'); fitting tries the opposite then perpendicular sides.
26
+ * @param props.align - horizontal anchor-edge alignment for 'bottom'/'top' bubbles: 'end' pins
27
+ * the bubble's right edge to the anchor's (for anchors beside other hover surfaces the centered
28
+ * bubble would overlap); default 'center'. Horizontal placements ignore it.
29
+ * @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
30
+ * stacking context (which confines the bubble's z-index to that context) cannot hide it.
25
31
  * @param props.delayMs - hover delay in milliseconds (default 0).
26
- * @param props.focusDelayMs - keyboard focus delay in milliseconds (default 0); blur, mouse
27
- * leave, disabling, and unmount cancel a pending show.
32
+ * @param props.focusDelayMs - keyboard focus delay in milliseconds (default 0); blur, click,
33
+ * mouse leave, disabling, and unmount cancel a pending show.
34
+ * @param props.gap - anchor-to-bubble distance in pixels for 'bottom'/'top' bubbles (default 8);
35
+ * horizontal placements use 10px, including after a flip.
28
36
  * @param props.disabled - suppress the bubble while true; the anchor renders identically so
29
37
  * toggling never remounts it (which would cut its CSS transitions).
30
- * @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
31
- * stacking context can neither clip the bubble nor paint over it.
32
38
  * @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
33
- * half-viewport cap would render a slab wider than the surface the anchor sits on.
39
+ * half-viewport cap would render a slab wider than the surface the anchor sits on; always bounded by viewport margins.
34
40
  * @param props.openOnClick - clicking also pins the bubble for reading; another click, Escape,
35
- * Tab, or an outside pointerdown dismisses it. Defaults to false, leaving an ordinary action
36
- * tooltip to hover and focus alone.
41
+ * Tab, or an outside pointerdown dismisses it. Defaults to false for ordinary action tooltips.
37
42
  * @param props.children - a single anchor element; its own ref (callback or object) is forwarded alongside the tooltip's.
38
43
  * An anchor that accepts no ref still positions the bubble: a raise records the element the event ran on.
39
- * @returns the cloned anchor plus a fixed-position bubble while hovered/focused.
44
+ * @returns the cloned anchor plus a fixed-position bubble, optionally portaled to the body.
45
+ * The bubble stays hidden until ResizeObserver supplies its size for viewport fitting; clicking the
46
+ * anchor dismisses the bubble unless openOnClick is enabled, and focus arriving after a pointer
47
+ * interaction (a closing menu refocusing its trigger) never raises it. When no side fits, the
48
+ * viewport-bounded fallback may overlap the anchor; oversized content is scrollable when pinned.
40
49
  */
41
- export declare function Tooltip({ label, shortcutKeys, side, delayMs, focusDelayMs, disabled, portal, maxWidth, openOnClick, children }: {
50
+ export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, children }: {
42
51
  label: TooltipLabel;
43
52
  shortcutKeys?: readonly string[] | undefined;
44
53
  side?: TooltipSide;
54
+ align?: 'center' | 'end';
45
55
  delayMs?: number;
46
56
  focusDelayMs?: number;
57
+ gap?: number;
47
58
  disabled?: boolean;
48
59
  portal?: boolean;
49
60
  maxWidth?: number;
50
61
  openOnClick?: boolean;
51
62
  children: ReactElement<AnchorProps>;
52
63
  }): import("react").JSX.Element;
53
- export {};
54
64
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -14,7 +14,7 @@ export interface FileTypeProjectContext {
14
14
  */
15
15
  export declare function isCodeFileType(type: string): type is CodeFileType;
16
16
  /**
17
- * Test whether an extension belonged to the established coarse LinkIcon code category.
17
+ * Test whether an extension belongs to the established coarse link-icon code category.
18
18
  * @param extension - Extension without a leading dot.
19
19
  * @returns Whether clickable links keep the code glyph for this extension.
20
20
  */