@deepseek-ai/dsh-client-ui-primitives 0.1.7-rc.2 → 0.2.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +8 -8
- package/README.md +16 -8
- package/README.zh.md +16 -8
- package/lib/DisclosureRow.module.css +14 -2
- package/lib/Menu.module.css +2 -2
- package/lib/MenuGroup.module.css +37 -0
- package/lib/Modal.module.css +5 -4
- package/lib/Switch.module.css +4 -0
- package/lib/TextShimmer.module.css +82 -21
- package/lib/Tooltip.module.css +1 -0
- package/lib/index.js +483 -283
- package/lib/types/DisclosureRow.d.ts +7 -3
- package/lib/types/Input.d.ts +4 -3
- package/lib/types/MenuGroup.d.ts +22 -0
- package/lib/types/TextShimmer.d.ts +14 -5
- package/lib/types/Tooltip.d.ts +10 -3
- package/lib/types/index.d.ts +2 -0
- package/lib/types/overlay-top-margin.d.ts +2 -8
- package/lib/types/useAnchoredMaxHeight.d.ts +2 -2
- package/lib/types/useAnchoredPosition.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
/** Shared 24px
|
|
2
|
+
/** Shared 24px process row: tertiary text and icons, secondary on hover. */
|
|
3
3
|
export interface DisclosureRowProps {
|
|
4
4
|
icon: ReactNode;
|
|
5
5
|
title: string;
|
|
6
6
|
open: boolean;
|
|
7
7
|
expandable: boolean;
|
|
8
8
|
onToggle: () => void;
|
|
9
|
-
/** Animate the
|
|
9
|
+
/** Animate the complete header while its owning operation is running. */
|
|
10
10
|
running?: boolean | undefined;
|
|
11
11
|
/** Makes the complete title row the disclosure target. */
|
|
12
12
|
expandOnRowClick?: boolean | undefined;
|
|
@@ -18,6 +18,10 @@ export interface DisclosureRowProps {
|
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
className?: string | undefined;
|
|
20
20
|
rowClassName?: string | undefined;
|
|
21
|
+
/** Sizing class for the header text area, beside the leading icon. */
|
|
22
|
+
contentClassName?: string | undefined;
|
|
23
|
+
/** Layout class shared by the header text and its decorative copy. */
|
|
24
|
+
contentLayoutClassName?: string | undefined;
|
|
21
25
|
leadingClassName?: string | undefined;
|
|
22
26
|
chevronClassName?: string | undefined;
|
|
23
27
|
titleClassName?: string | undefined;
|
|
@@ -28,5 +32,5 @@ export interface DisclosureRowProps {
|
|
|
28
32
|
* @param props - Visual content, controlled state, and interaction policy.
|
|
29
33
|
* @returns the disclosure row.
|
|
30
34
|
*/
|
|
31
|
-
export declare const DisclosureRow: import("react").MemoExoticComponent<({ icon, title, open, expandable, onToggle, running, expandOnRowClick, previewChevron, keepContentWhenOpen, collapsedContent, children, className, rowClassName, leadingClassName, chevronClassName, titleClassName, }: DisclosureRowProps) => import("react").JSX.Element>;
|
|
35
|
+
export declare const DisclosureRow: import("react").MemoExoticComponent<({ icon, title, open, expandable, onToggle, running, expandOnRowClick, previewChevron, keepContentWhenOpen, collapsedContent, children, className, rowClassName, contentClassName, contentLayoutClassName, leadingClassName, chevronClassName, titleClassName, }: DisclosureRowProps) => import("react").JSX.Element>;
|
|
32
36
|
//# sourceMappingURL=DisclosureRow.d.ts.map
|
package/lib/types/Input.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Render a text input with an optional leading icon.
|
|
4
4
|
* @param props.icon - optional 16px leading icon node.
|
|
5
|
+
* @param ref - the native input, cleared when it unmounts.
|
|
5
6
|
* @returns wrapper span containing the native input; input attributes pass through.
|
|
6
7
|
*/
|
|
7
|
-
export declare
|
|
8
|
+
export declare const Input: import("react").ForwardRefExoticComponent<{
|
|
8
9
|
icon?: ReactNode;
|
|
9
10
|
className?: string;
|
|
10
|
-
} & InputHTMLAttributes<HTMLInputElement>
|
|
11
|
+
} & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
12
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Accessible menu groups with shared sticky-heading presentation and viewport observation. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Render a named group with an instance-owned heading id and an inaccessible position sentinel.
|
|
5
|
+
* @param props - Caller-localized label and optional menu rows.
|
|
6
|
+
* @returns A section named by its direct heading, followed by the supplied children.
|
|
7
|
+
*/
|
|
8
|
+
export declare function MenuGroup({ label, children }: {
|
|
9
|
+
label: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Update heading backgrounds asynchronously from native intersection and viewport-size observations.
|
|
14
|
+
* Headings remain transparent until observations identify a section crossing the viewport top.
|
|
15
|
+
* Without IntersectionObserver or ResizeObserver, CSS sticky headings remain transparent.
|
|
16
|
+
* Group membership is captured at setup; dispose before observing changed groups or the same viewport again.
|
|
17
|
+
* @param viewport - Unpadded, borderless scroll container with direct MenuGroup children.
|
|
18
|
+
* @returns Cleanup owning both intersection observers and the viewport resize observer; disconnects
|
|
19
|
+
* them, ignores queued callbacks, and clears managed data-stuck attributes. No valid groups acquires nothing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function observeStickyMenuGroups(viewport: HTMLElement): () => void;
|
|
22
|
+
//# sourceMappingURL=MenuGroup.d.ts.map
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
/** Text activity animation shared by a row and its nested text fragments. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
1
3
|
/** Text and activity supplied by the owning row. */
|
|
2
4
|
export interface TextShimmerProps {
|
|
3
|
-
children
|
|
4
|
-
|
|
5
|
+
/** Text or presentational children with text in nested TextShimmer instances. No effects or element ids. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Whether to animate; nested instances share the containing row's activity. */
|
|
8
|
+
active?: boolean | undefined;
|
|
5
9
|
className?: string | undefined;
|
|
10
|
+
/** Layout class applied equally to the base and decorative content. */
|
|
11
|
+
contentClassName?: string | undefined;
|
|
6
12
|
}
|
|
7
13
|
/**
|
|
8
|
-
* Render text with
|
|
14
|
+
* Render text with one shared highlight while retaining selectable, accessible content.
|
|
15
|
+
* Nested instances inherit the outer animation. Keep icons outside; mark decorative
|
|
16
|
+
* separators with data-shimmer-decoration so their background follows the highlight.
|
|
17
|
+
* Active children also render in an inert, clipped decoration; supply only presentation.
|
|
9
18
|
* @param props - localized text, running state, and owner styling.
|
|
10
|
-
* @returns
|
|
19
|
+
* @returns retained text and its optional decorative highlight.
|
|
11
20
|
*/
|
|
12
|
-
export declare const TextShimmer: import("react").MemoExoticComponent<({ children, active, className }: TextShimmerProps) => import("react").JSX.Element>;
|
|
21
|
+
export declare const TextShimmer: import("react").MemoExoticComponent<({ children, active, className, contentClassName }: TextShimmerProps) => import("react").JSX.Element>;
|
|
13
22
|
//# sourceMappingURL=TextShimmer.d.ts.map
|
package/lib/types/Tooltip.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type TooltipSide = 'right' | 'bottom' | 'top';
|
|
|
9
9
|
export declare const TooltipSuppression: import("react").Context<((suppressed: boolean) => void) | null>;
|
|
10
10
|
/** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
|
|
11
11
|
interface AnchorProps {
|
|
12
|
+
'aria-describedby'?: string | undefined;
|
|
12
13
|
ref?: Ref<HTMLElement> | undefined;
|
|
13
14
|
onMouseEnter?: MouseEventHandler | undefined;
|
|
14
15
|
onMouseLeave?: MouseEventHandler | undefined;
|
|
@@ -27,29 +28,35 @@ type TooltipLabel = string | (() => string);
|
|
|
27
28
|
* bubble would overlap); default 'center'. Ignored for side 'right'.
|
|
28
29
|
* @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
|
|
29
30
|
* stacking context (which confines the bubble's z-index to that context) cannot hide it.
|
|
30
|
-
* @param props.delayMs - hover delay in milliseconds
|
|
31
|
+
* @param props.delayMs - hover delay in milliseconds (default 0).
|
|
32
|
+
* @param props.focusDelayMs - keyboard focus delay in milliseconds (default 0); blur, click,
|
|
33
|
+
* mouse leave, disabling, and unmount cancel a pending show.
|
|
31
34
|
* @param props.gap - anchor-to-bubble distance in pixels for 'bottom'/'top' bubbles (default 8);
|
|
32
35
|
* ignored for side 'right'.
|
|
33
36
|
* @param props.disabled - suppress the bubble while true; the anchor renders identically so
|
|
34
37
|
* toggling never remounts it (which would cut its CSS transitions).
|
|
35
38
|
* @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
|
|
36
39
|
* half-viewport cap would render a slab wider than the surface the anchor sits on.
|
|
40
|
+
* @param props.openOnClick - clicking also pins the bubble for reading; another click, Escape,
|
|
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
|
* @returns the cloned anchor plus a fixed-position bubble, optionally portaled to the body.
|
|
39
44
|
* The bubble stays hidden until ResizeObserver supplies its size for viewport fitting; clicking the
|
|
40
|
-
* anchor dismisses the bubble
|
|
45
|
+
* anchor dismisses the bubble unless openOnClick is enabled, and focus arriving after a pointer
|
|
41
46
|
* interaction (a closing menu refocusing its trigger) never raises it.
|
|
42
47
|
*/
|
|
43
|
-
export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, gap, disabled, portal, maxWidth, children }: {
|
|
48
|
+
export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, children }: {
|
|
44
49
|
label: TooltipLabel;
|
|
45
50
|
shortcutKeys?: readonly string[] | undefined;
|
|
46
51
|
side?: TooltipSide;
|
|
47
52
|
align?: 'center' | 'end';
|
|
48
53
|
delayMs?: number;
|
|
54
|
+
focusDelayMs?: number;
|
|
49
55
|
gap?: number;
|
|
50
56
|
disabled?: boolean;
|
|
51
57
|
portal?: boolean;
|
|
52
58
|
maxWidth?: number;
|
|
59
|
+
openOnClick?: boolean;
|
|
53
60
|
children: ReactElement<AnchorProps>;
|
|
54
61
|
}): import("react").JSX.Element;
|
|
55
62
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { Input } from './Input.tsx';
|
|
|
24
24
|
export { Menu, MenuItemButton } from './Menu.tsx';
|
|
25
25
|
export { MenuSurface } from './MenuSurface.tsx';
|
|
26
26
|
export type { MenuSurfaceProps } from './MenuSurface.tsx';
|
|
27
|
+
export { MenuGroup, observeStickyMenuGroups } from './MenuGroup.tsx';
|
|
27
28
|
export type { MenuItemButtonProps, MenuEntry, MenuItem, MenuSeparator, MenuLabel } from './Menu.tsx';
|
|
28
29
|
export { useAnchoredMaxHeight } from './useAnchoredMaxHeight.ts';
|
|
29
30
|
export { useAnchoredPosition } from './useAnchoredPosition.ts';
|
|
@@ -52,6 +53,7 @@ export type { CodeFileType, FileType, FileTypeIconProps, FileTypeKind, FileTypeP
|
|
|
52
53
|
export { projectUserText, type UserTextReferences } from './user-text.tsx';
|
|
53
54
|
export { Tooltip } from './Tooltip.tsx';
|
|
54
55
|
export type { TooltipSide } from './Tooltip.tsx';
|
|
56
|
+
export { pointerModality } from './input-modality.ts';
|
|
55
57
|
export { Toast } from './Toast.tsx';
|
|
56
58
|
export { fileSizeText } from './file-size.ts';
|
|
57
59
|
export { writeClipboard } from './clipboard.ts';
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Overlay clearance from the window's top strip. On macOS desktop the frame
|
|
3
|
-
* publishes `--dsh-frame-top-clearance` on the root element — the constant
|
|
4
|
-
* step below the traffic-light strip, where clicks drag the window instead of
|
|
5
|
-
* the overlay. JS-clamped overlays keep at least that much air above them.
|
|
6
|
-
* Elsewhere the property is absent and the caller's own margin applies.
|
|
7
|
-
*/
|
|
1
|
+
/** Shared viewport inset for overlays, derived from the desktop frame's reserved top strip. */
|
|
8
2
|
/**
|
|
9
3
|
* Resolve the top margin an overlay keeps from the viewport edge.
|
|
10
4
|
* @param min - the overlay's own viewport margin in px, used as the floor.
|
|
11
|
-
* @returns the larger of `min` and the frame
|
|
5
|
+
* @returns the larger of `min` and the frame clearance plus 20px; fullscreen keeps only the 20px gap.
|
|
12
6
|
*/
|
|
13
7
|
export declare function overlayTopMargin(min: number): number;
|
|
14
8
|
//# sourceMappingURL=overlay-top-margin.d.ts.map
|
|
@@ -5,8 +5,8 @@ import type { RefObject } from 'react';
|
|
|
5
5
|
* @param cap - design max-height in px (the clamp never exceeds it).
|
|
6
6
|
* @param signal - re-measure trigger: pass the overlay's render state so anchor
|
|
7
7
|
* moves (composer growth) re-fit; resize/scroll re-fit while mounted.
|
|
8
|
-
* @param margin - viewport top margin floor in px; the frame's
|
|
9
|
-
*
|
|
8
|
+
* @param margin - viewport top margin floor in px; the frame's overlay
|
|
9
|
+
* inset widens it. Callers under fixed chrome (the conversation header)
|
|
10
10
|
* raise it past their chrome's height.
|
|
11
11
|
* @returns the max-height to apply inline, in px.
|
|
12
12
|
*/
|
|
@@ -24,7 +24,7 @@ export interface AnchoredPositionOptions {
|
|
|
24
24
|
align?: 'start' | 'end';
|
|
25
25
|
/** Distance kept between the anchor edge named by `side` and the panel. */
|
|
26
26
|
gap: number;
|
|
27
|
-
/** Distance kept between the panel and each viewport edge. */
|
|
27
|
+
/** Distance kept between the panel and each viewport edge; the frame's overlay inset widens the top margin. */
|
|
28
28
|
margin: number;
|
|
29
29
|
}
|
|
30
30
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-primitives",
|
|
3
3
|
"description": "Pure React atoms for the dsh web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"micromark-extension-gfm": "^3.0.0",
|
|
48
48
|
"micromark-util-sanitize-uri": "^2.0.1",
|
|
49
49
|
"simple-icons": "16.31.0",
|
|
50
|
+
"@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
|
|
50
51
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-util-
|
|
53
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2"
|
|
52
|
+
"@deepseek-ai/dsh-util-code-language": "0.2.0-rc.2",
|
|
53
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.0-rc.2"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"lib/index.js",
|