@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.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/CHANGELOG.md +83 -0
- package/LICENSE +22 -0
- package/README.md +175 -2
- package/README.zh.md +176 -0
- package/THIRD_PARTY_NOTICES.md +42 -0
- package/UPSTREAM.md +59 -0
- package/dist/blocks.js +1617 -0
- package/dist/chunks/chunk-23KOEBWJ.js +104 -0
- package/dist/chunks/chunk-6SGSJ5KW.js +57 -0
- package/dist/chunks/chunk-7NH2UOZO.js +155 -0
- package/dist/chunks/chunk-7SKW4S35.js +66 -0
- package/dist/chunks/chunk-B3EEK7A2.js +408 -0
- package/dist/chunks/chunk-CEBTQO6W.js +24 -0
- package/dist/chunks/chunk-ENKPNYOB.js +26 -0
- package/dist/chunks/chunk-EWAZFWLW.js +27 -0
- package/dist/chunks/chunk-F352IICS.js +57 -0
- package/dist/chunks/chunk-FFJ6TCCF.js +31 -0
- package/dist/chunks/chunk-FZXK4LTI.js +129 -0
- package/dist/chunks/chunk-JA3XDLIA.js +1115 -0
- package/dist/chunks/chunk-L7XALG4J.js +36 -0
- package/dist/chunks/chunk-OCAQFVT3.js +3172 -0
- package/dist/chunks/chunk-RAXDA2PT.js +202 -0
- package/dist/chunks/chunk-RNVSCTW7.js +24 -0
- package/dist/chunks/chunk-RZOP2PFC.js +152 -0
- package/dist/chunks/chunk-SN6RSUWC.js +61 -0
- package/dist/chunks/chunk-SNVSQWCU.js +22 -0
- package/dist/chunks/chunk-SO3DCAWG.js +170 -0
- package/dist/chunks/chunk-UAEFKTV3.js +144 -0
- package/dist/chunks/chunk-UGEORMLD.js +89 -0
- package/dist/chunks/chunk-W6FLI3AK.js +112 -0
- package/dist/chunks/chunk-WX46TSKP.js +328 -0
- package/dist/chunks/chunk-XL33IPCV.js +261 -0
- package/dist/chunks/chunk-XW4L4ZGL.js +967 -0
- package/dist/chunks/chunk-YOBY6PSL.js +850 -0
- package/dist/chunks/chunk-ZA47FP7C.js +7 -0
- package/dist/icons.js +859 -0
- package/dist/index.js +1675 -0
- package/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/katex.css +1 -0
- package/dist/katex.css.d.ts +2 -0
- package/dist/markdown.js +225 -0
- package/dist/meta.json +7575 -0
- package/dist/root-inputs.json +86 -0
- package/dist/seekbuddy-card.js +7 -0
- package/dist/seekbuddy-empty.js +8 -0
- package/dist/seekbuddy-internal/DangerButton.js +7 -0
- package/dist/seekbuddy-internal/Mark.js +7 -0
- package/dist/seekbuddy-internal/Message.js +10 -0
- package/dist/seekbuddy-internal/Pagination.js +9 -0
- package/dist/seekbuddy-internal/StatusBadge.js +7 -0
- package/dist/seekbuddy-internal/SubtleButton.js +7 -0
- package/dist/seekbuddy-internal/Switch.js +7 -0
- package/dist/seekbuddy-internal/Upload.js +7 -0
- package/dist/seekbuddy-internal/date/Calendar.js +8 -0
- package/dist/seekbuddy-internal/date/DatePicker.js +9 -0
- package/dist/seekbuddy-internal/date/DateRangePicker.js +9 -0
- package/dist/seekbuddy-internal/date/TimePicker.js +8 -0
- package/dist/seekbuddy-internal/date/fields.js +16 -0
- package/dist/seekbuddy-internal/qr/QrCode.js +7 -0
- package/dist/seekbuddy-spinner.js +7 -0
- package/dist/seekbuddy-tabs.js +7 -0
- package/dist/seekbuddy-timeline.js +8 -0
- package/dist/seekbuddy.js +89 -0
- package/dist/theme-bootstrap.js +13 -0
- package/dist/theme.js +37 -0
- package/dist/tokens.css +974 -0
- package/dist/tokens.css.d.ts +2 -0
- package/dist/types/AnimatedRows.d.ts +45 -0
- package/dist/types/Button.d.ts +18 -0
- package/dist/types/Checkbox.d.ts +19 -0
- package/dist/types/CodeFileIcon.d.ts +11 -0
- package/dist/types/CodeToolbar.d.ts +29 -0
- package/dist/types/CommandText.d.ts +15 -0
- package/dist/types/ConfigField.d.ts +32 -0
- package/dist/types/ConnectionIndicator.d.ts +25 -0
- package/dist/types/DetailDocument.d.ts +77 -0
- package/dist/types/DiffBlock.d.ts +51 -0
- package/dist/types/DisclosureRow.d.ts +37 -0
- package/dist/types/DraggableImage.d.ts +18 -0
- package/dist/types/FileTypeIcon.d.ts +42 -0
- package/dist/types/FoldToggle.d.ts +19 -0
- package/dist/types/HoverCard.d.ts +44 -0
- package/dist/types/HoverCardGroup.d.ts +24 -0
- package/dist/types/ImageLightbox.d.ts +29 -0
- package/dist/types/ImagePreview.d.ts +11 -0
- package/dist/types/InlineEditor.d.ts +22 -0
- package/dist/types/Input.d.ts +11 -0
- package/dist/types/JsonTree.d.ts +58 -0
- package/dist/types/LinkIcon.d.ts +33 -0
- package/dist/types/Menu.d.ts +163 -0
- package/dist/types/MenuGroup.d.ts +21 -0
- package/dist/types/MenuSurface.d.ts +24 -0
- package/dist/types/Modal.d.ts +43 -0
- package/dist/types/PermissionIcon.d.ts +50 -0
- package/dist/types/Pill.d.ts +12 -0
- package/dist/types/QuotePreview.d.ts +23 -0
- package/dist/types/ReadBlock.d.ts +47 -0
- package/dist/types/ReferenceIcon.d.ts +20 -0
- package/dist/types/RiskConfirmation.d.ts +19 -0
- package/dist/types/SearchBlock.d.ts +71 -0
- package/dist/types/SegmentedControl.d.ts +34 -0
- package/dist/types/SegmentedTabs.d.ts +27 -0
- package/dist/types/ShortcutKeys.d.ts +10 -0
- package/dist/types/SiteGlyph.d.ts +24 -0
- package/dist/types/StateDot.d.ts +19 -0
- package/dist/types/Switch.d.ts +19 -0
- package/dist/types/Tag.d.ts +31 -0
- package/dist/types/TerminalBlock.d.ts +85 -0
- package/dist/types/TextShimmer.d.ts +22 -0
- package/dist/types/Toast.d.ts +48 -0
- package/dist/types/Tooltip.d.ts +69 -0
- package/dist/types/UserMessageBubble.d.ts +10 -0
- package/dist/types/WebBlock.d.ts +60 -0
- package/dist/types/ZoomControls.d.ts +26 -0
- package/dist/types/ansi.d.ts +16 -0
- package/dist/types/blocks.d.ts +21 -0
- package/dist/types/clipboard.d.ts +8 -0
- package/dist/types/code-file-icon-artwork.d.ts +53 -0
- package/dist/types/code-file-types.d.ts +29 -0
- package/dist/types/code-highlighting.d.ts +11 -0
- package/dist/types/css-modules.d.ts +6 -0
- package/dist/types/darwin-desktop.d.ts +8 -0
- package/dist/types/document-zoom.d.ts +16 -0
- package/dist/types/file-drag-actions.d.ts +36 -0
- package/dist/types/file-size.d.ts +7 -0
- package/dist/types/focus.d.ts +15 -0
- package/dist/types/guide-artwork.d.ts +14 -0
- package/dist/types/head-tail-cap.d.ts +22 -0
- package/dist/types/icons/artwork.d.ts +421 -0
- package/dist/types/icons/index.d.ts +397 -0
- package/dist/types/icons/props.d.ts +8 -0
- package/dist/types/icons/shared-artwork.d.ts +36 -0
- package/dist/types/icons.d.ts +6 -0
- package/dist/types/image-drag.d.ts +16 -0
- package/dist/types/index.d.ts +71 -0
- package/dist/types/input-modality.d.ts +18 -0
- package/dist/types/keyboard-composition.d.ts +10 -0
- package/dist/types/markdown/CodeBlock.d.ts +34 -0
- package/dist/types/markdown/JsonBlock.d.ts +7 -0
- package/dist/types/markdown/MarkdownDelegate.d.ts +68 -0
- package/dist/types/markdown/MarkdownText.d.ts +54 -0
- package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
- package/dist/types/markdown/file-link.d.ts +22 -0
- package/dist/types/markdown/highlight.d.ts +169 -0
- package/dist/types/markdown/incremental.d.ts +79 -0
- package/dist/types/markdown/katex.d.ts +18 -0
- package/dist/types/markdown/local-image-syntax.d.ts +9 -0
- package/dist/types/markdown/mathCompatibility.d.ts +10 -0
- package/dist/types/markdown/parse.d.ts +24 -0
- package/dist/types/markdown/plain-text.d.ts +21 -0
- package/dist/types/markdown/quote-text.d.ts +7 -0
- package/dist/types/markdown/render.d.ts +145 -0
- package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
- package/dist/types/markdown/windows-path-destinations.d.ts +10 -0
- package/dist/types/markdown.d.ts +12 -0
- package/dist/types/overlay-top-margin.d.ts +14 -0
- package/dist/types/plugin-artwork.d.ts +16 -0
- package/dist/types/pointer-grace.d.ts +21 -0
- package/dist/types/rank-by-name.d.ts +21 -0
- package/dist/types/relative-time.d.ts +22 -0
- package/dist/types/seekbuddy/Card.d.ts +28 -0
- package/dist/types/seekbuddy/DangerButton.d.ts +31 -0
- package/dist/types/seekbuddy/Empty.d.ts +34 -0
- package/dist/types/seekbuddy/Mark.d.ts +27 -0
- package/dist/types/seekbuddy/Message.d.ts +52 -0
- package/dist/types/seekbuddy/Pagination.d.ts +66 -0
- package/dist/types/seekbuddy/Spinner.d.ts +20 -0
- package/dist/types/seekbuddy/StatusBadge.d.ts +33 -0
- package/dist/types/seekbuddy/SubtleButton.d.ts +30 -0
- package/dist/types/seekbuddy/Switch.d.ts +36 -0
- package/dist/types/seekbuddy/Tabs.d.ts +49 -0
- package/dist/types/seekbuddy/Timeline.d.ts +42 -0
- package/dist/types/seekbuddy/Upload.d.ts +101 -0
- package/dist/types/seekbuddy/date/Calendar.d.ts +94 -0
- package/dist/types/seekbuddy/date/DatePicker.d.ts +29 -0
- package/dist/types/seekbuddy/date/DateRangePicker.d.ts +41 -0
- package/dist/types/seekbuddy/date/TimePicker.d.ts +35 -0
- package/dist/types/seekbuddy/date/date.d.ts +79 -0
- package/dist/types/seekbuddy/date/fields.d.ts +45 -0
- package/dist/types/seekbuddy/index.d.ts +49 -0
- package/dist/types/seekbuddy/qr/QrCode.d.ts +37 -0
- package/dist/types/seekbuddy/qr/qr.d.ts +38 -0
- package/dist/types/theme-bootstrap.d.ts +3 -0
- package/dist/types/theme-core.d.ts +14 -0
- package/dist/types/theme.d.ts +4 -0
- package/dist/types/tooltip-placement.d.ts +34 -0
- package/dist/types/use-clipboard-copy.d.ts +13 -0
- package/dist/types/useAnchoredMaxHeight.d.ts +13 -0
- package/dist/types/useAnchoredPosition.d.ts +35 -0
- package/dist/types/useDismissOnOutsidePointer.d.ts +10 -0
- package/dist/types/useModalLayer.d.ts +26 -0
- package/dist/types/useRowDragPreview.d.ts +19 -0
- package/dist/types/user-text.d.ts +31 -0
- package/package.json +151 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Extension } from 'mdast-util-from-markdown';
|
|
2
|
+
/**
|
|
3
|
+
* CommonMark reads `\.` or `\_` in a destination as an escaped character, so
|
|
4
|
+
* `D:\repo\.github` would parse as `D:\repo.github`. For a destination that
|
|
5
|
+
* is a Windows path, this `fromMarkdown` extension keeps every backslash
|
|
6
|
+
* literally, including one before punctuation such as `\(`, while character
|
|
7
|
+
* references such as `&` still decode; other destinations parse unchanged.
|
|
8
|
+
* @returns The mdast extension.
|
|
9
|
+
*/
|
|
10
|
+
export declare function windowsPathDestinations(): Extension;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { CodeBlock } from './markdown/CodeBlock.js';
|
|
2
|
+
export type { CodeBlockProps } from './markdown/CodeBlock.js';
|
|
3
|
+
export { JsonBlock } from './markdown/JsonBlock.js';
|
|
4
|
+
export { MarkdownDelegateProvider, useMarkdownDelegate } from './markdown/MarkdownDelegate.js';
|
|
5
|
+
export type { MarkdownMenuTarget, MarkdownDelegate, MarkdownDelegateProviderProps, MarkdownExternalLinkHandler, } from './markdown/MarkdownDelegate.js';
|
|
6
|
+
export { DetailDocument, detailDocumentState, useDetailDocumentLabels } from './DetailDocument.js';
|
|
7
|
+
export type { DetailDocumentCopy, DetailDocumentLabels, DetailDocumentRead, DetailDocumentState, } from './DetailDocument.js';
|
|
8
|
+
export { MarkdownText } from './markdown/MarkdownText.js';
|
|
9
|
+
export type { MarkdownCodeLabels, MarkdownFileMentions, MarkdownLabels, MarkdownPathImages, } from './markdown/MarkdownText.js';
|
|
10
|
+
export { formatQuoteText } from './markdown/quote-text.js';
|
|
11
|
+
export { extractMarkdownPlainText } from './markdown/plain-text.js';
|
|
12
|
+
export type { MarkdownPlainTextMode, MarkdownPlainTextOptions } from './markdown/plain-text.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Shared viewport inset for overlays, derived from the desktop frame's reserved top strip. */
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the top margin an overlay keeps from the viewport edge.
|
|
4
|
+
* @param min - the overlay's own viewport margin in px, used as the floor.
|
|
5
|
+
* @param anchor - the overlay's anchor rect in viewport coordinates. While the anchor's top edge is inside the
|
|
6
|
+
* viewport, the margin never exceeds `anchor.bottom + gap`, so an overlay opened from a control inside the top strip
|
|
7
|
+
* stays next to it.
|
|
8
|
+
* @param gap - the distance the overlay keeps below `anchor`.
|
|
9
|
+
* @returns the frame clearance plus 20px (20px in fullscreen), capped by a visible `anchor`, but never below `min`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function overlayTopMargin(min: number, anchor?: {
|
|
12
|
+
readonly top: number;
|
|
13
|
+
readonly bottom: number;
|
|
14
|
+
}, gap?: number): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconProps } from './icons/props.js';
|
|
2
|
+
/** Light-blue terminal artwork shared by plugin cards and sidebar guide entries. */
|
|
3
|
+
export declare const PluginArtworkTerminal: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
4
|
+
/** Agent-loop plugin artwork (four leaves circling a center). */
|
|
5
|
+
export declare const PluginArtworkLoop: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
6
|
+
/** Subagent plugin artwork (two stacked rounded squares); also marks every row inside a bundle. */
|
|
7
|
+
export declare const PluginArtworkSubagent: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Web-search plugin artwork (conic-gradient ring and handle). SVG has no
|
|
10
|
+
* native conic gradient, so the ring clips an HTML div painted with CSS
|
|
11
|
+
* `conic-gradient` — the same emulation Figma exports; it renders inline in
|
|
12
|
+
* the browser UI but would stay empty in an `<img>` or mask context.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PluginArtworkSearch: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
15
|
+
/** Default plugin artwork for plugins without one of their own (connector blocks and a node). */
|
|
16
|
+
export declare const PluginArtworkDefault: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grace before a pointer-dismissed popup closes. Covers the anchor->popup gap
|
|
3
|
+
* (8px for HoverCard, 4px for Menu) at a hand's travel speed without leaving a
|
|
4
|
+
* popup lingering once the pointer has genuinely moved on.
|
|
5
|
+
*/
|
|
6
|
+
export declare const POINTER_GRACE_MS = 200;
|
|
7
|
+
/** Cancelable delayed close for a pointer-dismissed popup. */
|
|
8
|
+
export interface PointerGrace {
|
|
9
|
+
/** Schedule the close {@link POINTER_GRACE_MS} from now, replacing any pending one. */
|
|
10
|
+
arm: () => void;
|
|
11
|
+
/** Abort a pending close (the pointer came back). */
|
|
12
|
+
cancel: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Delay a pointer-dismissed popup's close so the pointer can cross the gap
|
|
16
|
+
* between anchor and popup. A pending close is dropped on unmount.
|
|
17
|
+
* @param close - runs when the grace elapses with no re-entry; read at fire
|
|
18
|
+
* time, so callers may pass a fresh closure each render.
|
|
19
|
+
* @returns the {@link PointerGrace} handle.
|
|
20
|
+
*/
|
|
21
|
+
export declare function usePointerGrace(close: () => void): PointerGrace;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared ranking for `/` menu candidates: the query must be a
|
|
3
|
+
* case-insensitive ordered subsequence of the candidate name or, when the
|
|
4
|
+
* candidate carries one, of its display label (a localized title). Prefix
|
|
5
|
+
* hits rank first, then the strongest alignment score over either key, then
|
|
6
|
+
* the source order of the input. Decision record:
|
|
7
|
+
* .agents/notes/archived/feature/2026-08-04-web-slash-command-fuzzy-discovery.md
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Rank named items by a menu query.
|
|
11
|
+
* @param items - candidates in source order (a host catalog, then client
|
|
12
|
+
* contributions); an item's optional `label` is a second search key beside
|
|
13
|
+
* its name.
|
|
14
|
+
* @param rawQuery - the text typed after the trigger, matched case-insensitively.
|
|
15
|
+
* @returns the matching items: prefix hits first, then by alignment score,
|
|
16
|
+
* then in source order. The input list itself for an empty query.
|
|
17
|
+
*/
|
|
18
|
+
export declare function rankByName<T extends {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly label?: string;
|
|
21
|
+
}>(items: readonly T[], rawQuery: string): readonly T[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact relative-time bucketing shared by every surface that dates a
|
|
3
|
+
* session. Bucketing is here so two surfaces naming the same session agree;
|
|
4
|
+
* the words stay in each plugin's own dictionary, per locale-owned copy.
|
|
5
|
+
*
|
|
6
|
+
* @module @deepseek-ai/dsh-client-ui-primitives/relative-time
|
|
7
|
+
*/
|
|
8
|
+
/** Relative-time bucket of a dated row's trailing label. */
|
|
9
|
+
export type RelativeTimeUnit = 'now' | 'minutes' | 'hours' | 'days' | 'months' | 'years';
|
|
10
|
+
/** Structured relative time: the bucket plus its magnitude (0 for 'now'). */
|
|
11
|
+
export interface RelativeTime {
|
|
12
|
+
unit: RelativeTimeUnit;
|
|
13
|
+
n: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Compact relative time, as a structured bucket the renderer localizes
|
|
17
|
+
* ("now"/"5min"/"3h"/"2d"/"4mo"/"1y" in en).
|
|
18
|
+
* @param at - epoch ms of the dated moment.
|
|
19
|
+
* @param now - current epoch ms (injected for pure rendering).
|
|
20
|
+
* @returns the row's trailing time bucket and magnitude.
|
|
21
|
+
*/
|
|
22
|
+
export declare function relativeTime(at: number, now: number): RelativeTime;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/** Inner padding: `none` = 0 (self-laid-out content such as a cover image), `sm` = 14px (dense catalog cards), `md` = 16px (default). */
|
|
3
|
+
export type CardPadding = 'none' | 'sm' | 'md';
|
|
4
|
+
/** Rendered element; pick `li` inside a list so the card needs no wrapper. */
|
|
5
|
+
export type CardElement = 'div' | 'section' | 'article' | 'li';
|
|
6
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
7
|
+
/** Inner padding; see `CardPadding`. Default `md` (16px). */
|
|
8
|
+
padding?: CardPadding | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Hover feedback for cards the caller makes clickable: the translucent `--dsw-alias-interactive-bg-hover`
|
|
11
|
+
* fill upstream's plugin cards use, plus the pointer cursor.
|
|
12
|
+
* Styling only — clicking is wired by the caller (`onClick` here, or a `<button>` inside).
|
|
13
|
+
*/
|
|
14
|
+
interactive?: boolean | undefined;
|
|
15
|
+
/** Element to render; see `CardElement`. Default `div`. */
|
|
16
|
+
as?: CardElement | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Card surface only — background, hairline stroke, radius, elevation, padding — with the content
|
|
20
|
+
* left entirely to `children`. Upstream primitives ship no card / panel, so hand-rolled cards
|
|
21
|
+
* tend to drift apart. No header / footer / title slots by design:
|
|
22
|
+
* business cards do not share an inner structure, so the library does not pretend they do.
|
|
23
|
+
*
|
|
24
|
+
* Server-safe (no hooks, no DOM access): a Next.js Server Component may import it from
|
|
25
|
+
* `@seekbuddy/dsh-ui/seekbuddy/card`. Sets no `role` / `tabIndex` — a fully clickable card is the
|
|
26
|
+
* caller's accessibility decision (put a `<button>` inside, or wire `role="button"` + keyboard).
|
|
27
|
+
*/
|
|
28
|
+
export declare function Card({ padding, interactive, as: Element, className, ...rest }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { Button } from '@seekbuddy/dsh-ui';
|
|
3
|
+
/** Upstream `Button` props minus `variant`: the shape is fixed to the outline capsule. */
|
|
4
|
+
export type DangerButtonProps = Omit<ComponentPropsWithoutRef<typeof Button>, 'variant' | 'className'> & {
|
|
5
|
+
/** Extra class on the `<button>`, for layout. */
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Outline capsule in the error tone — red label and stroke — for destructive actions (delete,
|
|
10
|
+
* disable) and error-state affordances (e.g. a "review failed" chip that opens the reason).
|
|
11
|
+
*
|
|
12
|
+
* Upstream `ButtonVariant` has no danger family, and restyling the upstream `Button` through a
|
|
13
|
+
* consumer `className` tends to cover only the hover state. This owns the whole state set
|
|
14
|
+
* once — hover, active, focus-visible — while geometry, sizes and the disabled 40 % opacity stay
|
|
15
|
+
* with the upstream `Button` it wraps.
|
|
16
|
+
*
|
|
17
|
+
* Tokens: `--dsw-alias-state-error-primary` (label and stroke; the same token upstream `Menu`
|
|
18
|
+
* uses for its danger item), `--dsw-alias-interactive-bg-hover-danger` (hover fill), an 18 %
|
|
19
|
+
* `color-mix` of the error tone (active fill; no dedicated alias token), and the shared focus ring (width and colour from the theme's `focus.css`).
|
|
20
|
+
* All are theme-aware, so dark mode needs no extra rules.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DangerButton: import("react").ForwardRefExoticComponent<Omit<Omit<{
|
|
23
|
+
variant?: import("@seekbuddy/dsh-ui").ButtonVariant;
|
|
24
|
+
size?: 'md' | 'sm';
|
|
25
|
+
icon?: import("react").ReactNode;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
children?: import("react").ReactNode;
|
|
28
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>, "ref">, "className" | "variant"> & {
|
|
29
|
+
/** Extra class on the `<button>`, for layout. */
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** The three content states a data-driven view has to handle. */
|
|
3
|
+
export type EmptyStatus = 'loading' | 'empty' | 'error';
|
|
4
|
+
export interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
/** Which state to show. Precedence between loading / error / empty is the caller's decision. */
|
|
6
|
+
status: EmptyStatus;
|
|
7
|
+
/** Main line; localized by the caller. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Secondary line under the title. */
|
|
10
|
+
description?: ReactNode | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Leading visual. `undefined` picks the default for the status (spinner / search / warning);
|
|
13
|
+
* `null` renders no icon at all.
|
|
14
|
+
*/
|
|
15
|
+
icon?: ReactNode | null | undefined;
|
|
16
|
+
/** Action row (e.g. a "create" button for the empty state). Rendered before the retry button. */
|
|
17
|
+
action?: ReactNode | undefined;
|
|
18
|
+
/** Label of the retry button; rendered only for `status="error"` together with `onRetry`. */
|
|
19
|
+
retryLabel?: string | undefined;
|
|
20
|
+
/** Retry handler; rendered only for `status="error"` together with `retryLabel`. */
|
|
21
|
+
onRetry?: (() => void) | undefined;
|
|
22
|
+
/** Reserved height so a list that refreshes into a state does not jump. Default 240. */
|
|
23
|
+
minHeight?: number | string | undefined;
|
|
24
|
+
/** Dashed frame; turn off for full-screen or already-framed placements. Default `true`. */
|
|
25
|
+
bordered?: boolean | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Placeholder block for the loading / empty / error states of a page or a list region: icon,
|
|
29
|
+
* title, description and an action row. Text and buttons come from the caller; the component only
|
|
30
|
+
* fixes structure, tokens and the live-region semantics per state (`status` + polite for loading,
|
|
31
|
+
* `alert` for error, nothing for empty). server-safe (no hooks); the retry button needs a handler
|
|
32
|
+
* so it is only usable from Client Components.
|
|
33
|
+
*/
|
|
34
|
+
export declare function Empty({ status, title, description, icon, action, retryLabel, onRetry, minHeight, bordered, className, style, ...rest }: EmptyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Closed set of marks the extension layer knows how to draw. Each kind is one fixed meaning with
|
|
3
|
+
* its own glyph and colour token; adding a kind means adding an entry to `GLYPHS`, a colour class
|
|
4
|
+
* in `Mark.module.css` and a story — callers only ever pick a kind.
|
|
5
|
+
*/
|
|
6
|
+
export type MarkKind = 'official';
|
|
7
|
+
/** Pixel edge of the glyph. 14 / 16 next to card titles, 20 / 24 next to detail-page headings. */
|
|
8
|
+
export type MarkSize = 14 | 16 | 18 | 20 | 24;
|
|
9
|
+
export interface MarkProps {
|
|
10
|
+
/** Which mark to draw; each kind has a fixed glyph and colour. */
|
|
11
|
+
kind: MarkKind;
|
|
12
|
+
/** Screen-reader name and tooltip text, e.g. "Official"; localized by the caller. */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Default 16. */
|
|
15
|
+
size?: MarkSize | undefined;
|
|
16
|
+
/** Wrap in a hover / focus tooltip showing `label`. Default `true`; pass `false` when the meaning is already spelled out next to the mark. */
|
|
17
|
+
tooltip?: boolean | undefined;
|
|
18
|
+
/** Extra class on the root element, for layout. */
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Inline status mark: a fixed glyph with one meaning per `kind`, sized to sit on the text
|
|
23
|
+
* baseline without growing the line. Not a generic badge — no free icon or colour props.
|
|
24
|
+
* `<span role="img" aria-label tabIndex={0}>` so keyboard users can reach the tooltip; the SVG is
|
|
25
|
+
* decorative. Uses the upstream `Tooltip`, so it lives in the Client Component aggregate entry only.
|
|
26
|
+
*/
|
|
27
|
+
export declare function Mark({ kind, label, size, tooltip, className }: MarkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type MessageType = 'success' | 'info' | 'warning' | 'error' | 'loading';
|
|
3
|
+
export interface MessageOptions {
|
|
4
|
+
/** Default `info`. */
|
|
5
|
+
type?: MessageType | undefined;
|
|
6
|
+
/** Message text or nodes. */
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
/** Seconds. Default 3; `0` stays until closed. `loading` defaults to 0. */
|
|
9
|
+
duration?: number | undefined;
|
|
10
|
+
/** Re-opening with the same key updates that message in place (e.g. loading → success). */
|
|
11
|
+
key?: string | undefined;
|
|
12
|
+
/** Replaces the type's default glyph. */
|
|
13
|
+
icon?: ReactNode | undefined;
|
|
14
|
+
/** Called after the message has faded out, however it closed: timeout, `close()`, `destroy`, or eviction by `maxCount`. */
|
|
15
|
+
onClose?: (() => void) | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Closes the message it was returned for. */
|
|
18
|
+
export type MessageClose = () => void;
|
|
19
|
+
export interface MessageApi {
|
|
20
|
+
/** Shows a message with full options; returns a function that closes it. */
|
|
21
|
+
open(options: MessageOptions): MessageClose;
|
|
22
|
+
/** Shows a success message; `duration` in seconds (default 3, `0` keeps it open). */
|
|
23
|
+
success(content: ReactNode, duration?: number): MessageClose;
|
|
24
|
+
/** Shows an info message; `duration` in seconds (default 3, `0` keeps it open). */
|
|
25
|
+
info(content: ReactNode, duration?: number): MessageClose;
|
|
26
|
+
/** Shows a warning message; `duration` in seconds (default 3, `0` keeps it open). */
|
|
27
|
+
warning(content: ReactNode, duration?: number): MessageClose;
|
|
28
|
+
/** Shows an error message; `duration` in seconds (default 3, `0` keeps it open). */
|
|
29
|
+
error(content: ReactNode, duration?: number): MessageClose;
|
|
30
|
+
/** Shows a loading message; it stays until closed unless `duration` is given. */
|
|
31
|
+
loading(content: ReactNode, duration?: number): MessageClose;
|
|
32
|
+
/** Without a key closes every message. */
|
|
33
|
+
destroy(key?: string): void;
|
|
34
|
+
}
|
|
35
|
+
export interface MessageProviderProps {
|
|
36
|
+
/** Distance from the viewport top in px. Default 120, where the upstream Toast sits. */
|
|
37
|
+
top?: number | undefined;
|
|
38
|
+
/** Messages shown at once; the oldest closes when exceeded. Default 3. */
|
|
39
|
+
maxCount?: number | undefined;
|
|
40
|
+
/** The subtree that may call `useMessage()`. */
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Stacked transient messages: antd's `useMessage` shape on top of the upstream Toast look.
|
|
45
|
+
* The provider owns the stack and renders it through a body portal only while something is
|
|
46
|
+
* showing, so server rendering never touches `document`. A provider per page root, not a global
|
|
47
|
+
* singleton — separately built bundles on one page each include their own copy of this module, so a
|
|
48
|
+
* module-level store would split across them.
|
|
49
|
+
*/
|
|
50
|
+
export declare function MessageProvider({ top, maxCount, children }: MessageProviderProps): import("react").JSX.Element;
|
|
51
|
+
/** The message API of the nearest `MessageProvider`; stable across renders. Throws outside one. */
|
|
52
|
+
export declare function useMessage(): MessageApi;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** All user-visible text, localized by the caller. */
|
|
3
|
+
export interface PaginationLabels {
|
|
4
|
+
/** `aria-label` of the `<nav>`, e.g. "Pagination". */
|
|
5
|
+
navigation: string;
|
|
6
|
+
/** `aria-label` of the previous-page button. */
|
|
7
|
+
previous: string;
|
|
8
|
+
/** `aria-label` of the next-page button. */
|
|
9
|
+
next: string;
|
|
10
|
+
/** `aria-label` of a page button, e.g. `(page) => \`Page ${page}\``. */
|
|
11
|
+
page: (page: number) => string;
|
|
12
|
+
/** `aria-label` of the ellipsis that jumps back, e.g. "Previous 5 pages". */
|
|
13
|
+
jumpPrevious: string;
|
|
14
|
+
/** `aria-label` of the ellipsis that jumps forward. */
|
|
15
|
+
jumpNext: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PaginationProps {
|
|
18
|
+
/** Controlled current page (1-based). Omit for uncontrolled with `defaultCurrent`. */
|
|
19
|
+
current?: number | undefined;
|
|
20
|
+
/** Initial page when uncontrolled. Default 1. */
|
|
21
|
+
defaultCurrent?: number | undefined;
|
|
22
|
+
/** Items per page; with `total` this yields the page count. */
|
|
23
|
+
pageSize?: number | undefined;
|
|
24
|
+
/** Initial page size when `pageSize` is omitted. Default 10. */
|
|
25
|
+
defaultPageSize?: number | undefined;
|
|
26
|
+
/** Total item count. */
|
|
27
|
+
total: number;
|
|
28
|
+
/** Fired with the target page; `pageSize` rides along so a future size changer keeps the signature. */
|
|
29
|
+
onChange?: ((page: number, pageSize: number) => void) | undefined;
|
|
30
|
+
/** Summary rendered at the start, e.g. `(total, [from, to]) => \`${from}–${to} of ${total}\``. */
|
|
31
|
+
showTotal?: ((total: number, range: [number, number]) => ReactNode) | undefined;
|
|
32
|
+
/** Render nothing when everything fits on one page. Default `true` (antd defaults to `false`). */
|
|
33
|
+
hideOnSinglePage?: boolean | undefined;
|
|
34
|
+
/** Previous / `current / pages` / next only. */
|
|
35
|
+
simple?: boolean | undefined;
|
|
36
|
+
/** Middle window of 3 page buttons instead of 5, for narrow rows. */
|
|
37
|
+
showLessItems?: boolean | undefined;
|
|
38
|
+
/** Disables every button in the strip. */
|
|
39
|
+
disabled?: boolean | undefined;
|
|
40
|
+
/** All visible and screen-reader text; see `PaginationLabels`. */
|
|
41
|
+
labels: PaginationLabels;
|
|
42
|
+
/** Extra class on the root `<nav>`, for layout. */
|
|
43
|
+
className?: string | undefined;
|
|
44
|
+
}
|
|
45
|
+
/** One slot of the page strip: a page button or an ellipsis that jumps by the window size. */
|
|
46
|
+
export type PaginationItem = {
|
|
47
|
+
type: 'page';
|
|
48
|
+
page: number;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'jump-previous' | 'jump-next';
|
|
51
|
+
page: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* antd's page strip: with few pages list them all; otherwise keep page 1 and the last page, a
|
|
55
|
+
* window of 5 (or 3) around `current`, and an ellipsis on each side that has a gap. Jumps move by
|
|
56
|
+
* the window size, clamped. Pure, exported for tests.
|
|
57
|
+
*/
|
|
58
|
+
export declare function pageItems(current: number, pages: number, lessItems?: boolean): PaginationItem[];
|
|
59
|
+
/**
|
|
60
|
+
* Page navigation for catalog lists. Mirrors a subset of antd's Pagination:
|
|
61
|
+
* controlled or uncontrolled `current`, `total` + `pageSize` → page count, first / last page
|
|
62
|
+
* always visible with ellipsis jumps, `showTotal`, `simple`, `hideOnSinglePage`. Text comes from
|
|
63
|
+
* `labels`; the component has no strings of its own. Client Component (state for the
|
|
64
|
+
* uncontrolled mode), aggregate entry only.
|
|
65
|
+
*/
|
|
66
|
+
export declare function Pagination({ current, defaultCurrent, pageSize, defaultPageSize, total, onChange, showTotal, hideOnSinglePage, simple, showLessItems, disabled, labels, className, }: PaginationProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** `sm` = 0.85rem / 2px ring for buttons and inline text; `md` = 2rem / 3px for page-level waits. */
|
|
2
|
+
export type SpinnerSize = 'sm' | 'md';
|
|
3
|
+
/** `inherit` rides `currentColor` (button foreground); `page` pins `--dsw-alias-label-primary`. */
|
|
4
|
+
export type SpinnerTone = 'inherit' | 'page';
|
|
5
|
+
export interface SpinnerProps {
|
|
6
|
+
/** Ring size; see `SpinnerSize`. Default `sm`. */
|
|
7
|
+
size?: SpinnerSize | undefined;
|
|
8
|
+
/** Ring colour source; see `SpinnerTone`. Default `inherit`. */
|
|
9
|
+
tone?: SpinnerTone | undefined;
|
|
10
|
+
/** Screen-reader text; when present the spinner becomes a live status region instead of aria-hidden. */
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
/** Extra class on the root element, for layout. */
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The shared loading ring: track = currentColor at
|
|
17
|
+
* 35%, arc = currentColor, reduced motion keeps a static two-tone ring. Without `label`
|
|
18
|
+
* it is decorative (`aria-hidden`) and the surrounding text must say what is loading.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Spinner({ size, tone, label, className }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Closed set of tones. Each one is a fixed meaning with its own state dot and theme token; adding a
|
|
4
|
+
* tone means adding an entry here and in `DOTS`, a colour class in `StatusBadge.module.css` and a
|
|
5
|
+
* story — callers only pick a tone, never a colour.
|
|
6
|
+
*/
|
|
7
|
+
export type StatusTone = 'neutral' | 'success' | 'progress' | 'warning' | 'error';
|
|
8
|
+
export interface StatusBadgeProps {
|
|
9
|
+
/** Meaning of the badge, which fixes its dot and colour; see `StatusTone`. */
|
|
10
|
+
tone: StatusTone;
|
|
11
|
+
/** Label text; localized by the caller. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Drop the leading dot when the row already carries one. Default `true`. */
|
|
14
|
+
dot?: boolean | undefined;
|
|
15
|
+
/** Extra class on the root element, for layout. */
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read-only status chip: a state dot plus a label, in one of five tones — "running", "mounting",
|
|
20
|
+
* "not connected", "mount failed", "delisted" and friends.
|
|
21
|
+
*
|
|
22
|
+
* The dot is the upstream `StateDot` (the same glyph the terminal block uses for run state), so
|
|
23
|
+
* `progress` gets upstream's animated chase rather than a second spinner vocabulary. Colour comes
|
|
24
|
+
* from the tone: upstream `Pill` has no tone variants, and recolouring an upstream component through
|
|
25
|
+
* a consumer `className` couples the caller to its internal styles. This owns the tones once so no
|
|
26
|
+
* call site needs that override. Geometry — capsule,
|
|
27
|
+
* height, font — stays with the `Pill` it wraps.
|
|
28
|
+
*
|
|
29
|
+
* Static by design: no `onClick`, so `Pill` renders a `<span>` and there are no interactive states
|
|
30
|
+
* to keep in sync. The dot is `aria-hidden`; the label carries the meaning. Tokens are theme-aware
|
|
31
|
+
* (`--dsw-alias-state-*` / `--dsw-alias-label-tertiary`), so dark mode needs no extra rules.
|
|
32
|
+
*/
|
|
33
|
+
export declare function StatusBadge({ tone, children, dot, className }: StatusBadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { Button } from '@seekbuddy/dsh-ui';
|
|
3
|
+
/** Upstream `Button` props minus `variant`: the shape is fixed to the ghost capsule. */
|
|
4
|
+
export type SubtleButtonProps = Omit<ComponentPropsWithoutRef<typeof Button>, 'variant' | 'className'> & {
|
|
5
|
+
/** Extra class on the `<button>`, for layout. */
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Ghost capsule with a secondary label — for low-emphasis navigation that sits next to real actions
|
|
10
|
+
* (a card's "view details" link, a back button), where the default ghost label would compete with them.
|
|
11
|
+
*
|
|
12
|
+
* Upstream `ButtonVariant` has no quiet family, and setting `color` on a ghost `Button` through a consumer
|
|
13
|
+
* `className` covers its resting state only. This owns the whole state set once — the label steps up to the
|
|
14
|
+
* primary label on hover and press, plus a focus-visible ring — while geometry, sizes, the hover / press
|
|
15
|
+
* fills and the disabled 40 % opacity stay with the upstream ghost `Button` it wraps.
|
|
16
|
+
*
|
|
17
|
+
* Tokens: `--dsw-alias-label-secondary` (resting label), `--dsw-alias-label-primary` (hover / press label)
|
|
18
|
+
* and the shared focus ring (width and colour from the theme's `focus.css`).
|
|
19
|
+
* All are theme-aware, so dark mode needs no extra rules.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SubtleButton: import("react").ForwardRefExoticComponent<Omit<Omit<{
|
|
22
|
+
variant?: import("@seekbuddy/dsh-ui").ButtonVariant;
|
|
23
|
+
size?: 'md' | 'sm';
|
|
24
|
+
icon?: import("react").ReactNode;
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
children?: import("react").ReactNode;
|
|
27
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>, "ref">, "className" | "variant"> & {
|
|
28
|
+
/** Extra class on the `<button>`, for layout. */
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
/** `large` = 44×22 (antd default), `medium` = 36×20 (default), `small` = 28×16 for dense rows and table cells. */
|
|
3
|
+
export type SwitchSize = 'large' | 'medium' | 'small';
|
|
4
|
+
export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'onClick' | 'children' | 'type' | 'role' | 'aria-checked' | 'defaultValue'> {
|
|
5
|
+
/** Controlled state; when given, the caller owns it and `defaultChecked` is ignored. */
|
|
6
|
+
checked?: boolean | undefined;
|
|
7
|
+
/** Initial state for the uncontrolled form. */
|
|
8
|
+
defaultChecked?: boolean | undefined;
|
|
9
|
+
/** Alias of `defaultChecked` (antd parity). */
|
|
10
|
+
defaultValue?: boolean | undefined;
|
|
11
|
+
/** Content shown inside the track while on (short text or a 12px icon). */
|
|
12
|
+
checkedChildren?: ReactNode;
|
|
13
|
+
/** Content shown inside the track while off. */
|
|
14
|
+
unCheckedChildren?: ReactNode;
|
|
15
|
+
/** Blocks clicks and dims the switch; `onChange` does not fire. */
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
/** Track size; see `SwitchSize`. Default `medium`. */
|
|
18
|
+
size?: SwitchSize | undefined;
|
|
19
|
+
/** Fires when the value flips (after `onClick`); not fired while `disabled`. */
|
|
20
|
+
onChange?: ((checked: boolean, event: MouseEvent<HTMLButtonElement>) => void) | undefined;
|
|
21
|
+
/** Fires on every click with the value the switch is about to take. */
|
|
22
|
+
onClick?: ((checked: boolean, event: MouseEvent<HTMLButtonElement>) => void) | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Binary on/off toggle (`role="switch"`, WAI-ARIA switch pattern) with the antd `Switch` prop
|
|
26
|
+
* shape. Upstream's own `Switch` is a minimal, fully controlled control with a different prop shape; this
|
|
27
|
+
* one keeps antd's. Colours follow upstream's: on track
|
|
28
|
+
* `--dsw-alias-brand-primary` with thumb and track text in `--dsw-alias-label-primary-foreground`,
|
|
29
|
+
* off track a 40 % `color-mix` of `--dsw-alias-label-primary` with a `--dsw-alias-switch-thumb`
|
|
30
|
+
* thumb; capsule and thumb are true circles (`corner-shape: round`); no motion. Differences from antd (deliberate, only these two): the default `size` is `medium`
|
|
31
|
+
* (36×20) rather than `large`, and there is no `loading` prop.
|
|
32
|
+
*
|
|
33
|
+
* Accessibility: a switch without `checkedChildren` / `unCheckedChildren` is purely graphical, so
|
|
34
|
+
* pass `aria-label` (or `aria-labelledby` pointing at the visible row label).
|
|
35
|
+
*/
|
|
36
|
+
export declare function Switch({ checked, defaultChecked, defaultValue, checkedChildren, unCheckedChildren, disabled, size, onChange, onClick, className, ...rest }: SwitchProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface TabItem<T extends string> {
|
|
3
|
+
/** Stable identity of the tab; also the value handed to `onChange` (antd `items[].key`). */
|
|
4
|
+
key: T;
|
|
5
|
+
/** Visible tab text. */
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** Optional count badge; omitted when undefined. */
|
|
8
|
+
count?: number | undefined;
|
|
9
|
+
/** Skipped by the arrow keys and not selectable. */
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Optional panel content. When any item carries `children`, the component renders the
|
|
13
|
+
* active item's panel itself (`role="tabpanel"`, wired with `aria-controls` / `aria-labelledby`).
|
|
14
|
+
* Leave it out when the panel is routed content the caller renders (for example a router outlet).
|
|
15
|
+
*/
|
|
16
|
+
children?: ReactNode | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface TabsProps<T extends string> {
|
|
19
|
+
/** Accessible name of the tab list ("Skill views"). */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Tabs in display order. */
|
|
22
|
+
items: ReadonlyArray<TabItem<T>>;
|
|
23
|
+
/** Controlled selection (antd `activeKey`); the caller owns it (URL state, useState, …). */
|
|
24
|
+
activeKey: T;
|
|
25
|
+
/** Called with the key of the tab the user selects. */
|
|
26
|
+
onChange: (key: T) => void;
|
|
27
|
+
/**
|
|
28
|
+
* DOM id of a caller-rendered panel showing the selected tab's content. Every tab then declares
|
|
29
|
+
* `aria-controls={panelId}` and gets the id `<panelId>-tab-<key>` for the panel's `aria-labelledby`.
|
|
30
|
+
* Ignored when items carry `children` (ids are generated and wired automatically).
|
|
31
|
+
*/
|
|
32
|
+
panelId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Type scale of the tab labels: `sm` = `--dsw-font-xxs-12` (default; toolbars and in-card switches),
|
|
35
|
+
* `md` = `--dsw-font-s-14`, `lg` = `--dsw-font-base-16` (page-level view switches).
|
|
36
|
+
*/
|
|
37
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
38
|
+
/** Bold labels: every tab takes the `-strong-` variant of its size's font token (weight 600 in the theme). */
|
|
39
|
+
bold?: boolean | undefined;
|
|
40
|
+
/** Extra class on the root element, for layout. */
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Underline tab list (WAI-ARIA tabs, automatic activation): roving tabindex, arrow /
|
|
45
|
+
* Home / End keys move selection and focus, disabled tabs are skipped. Upstream ships
|
|
46
|
+
* no Tabs — its view switchers are rows of `Pill` — so this package provides one.
|
|
47
|
+
* Data-driven like antd's `items`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function Tabs<T extends string>({ label, items, activeKey, onChange, panelId, size, bold, className, }: TabsProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Run state shown by the left badge: grey spinner / green check / red cross / grey dash. */
|
|
3
|
+
export type TimelineStatus = 'running' | 'succeeded' | 'failed' | 'canceled';
|
|
4
|
+
export interface TimelineItem {
|
|
5
|
+
/** Stable identity of the entry (React key). */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Run state shown by the left badge. */
|
|
8
|
+
status: TimelineStatus;
|
|
9
|
+
/** Title line; may carry a `Pill` tag or other inline nodes. */
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
/** Grey metadata parts (trigger kind, time, duration); the component spaces them. */
|
|
12
|
+
meta?: ReadonlyArray<ReactNode> | undefined;
|
|
13
|
+
/** Optional third line — rendered in the error color for `failed`, grey otherwise. */
|
|
14
|
+
message?: ReactNode | undefined;
|
|
15
|
+
/** When given the whole entry becomes a button (keep `message` free of interactive nodes). */
|
|
16
|
+
onSelect?: (() => void) | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface TimelineGroup {
|
|
19
|
+
/** Stable identity of the group (React key). */
|
|
20
|
+
key: string;
|
|
21
|
+
/** Group heading such as a date bucket ("Today"); omit for a headless single group. */
|
|
22
|
+
heading?: ReactNode | undefined;
|
|
23
|
+
/** Entries of the group, in display order. */
|
|
24
|
+
items: ReadonlyArray<TimelineItem>;
|
|
25
|
+
}
|
|
26
|
+
export interface TimelineProps {
|
|
27
|
+
/** Accessible name of the whole timeline ("Run history"). */
|
|
28
|
+
label: string;
|
|
29
|
+
/** Screen-reader text per status; badges themselves are aria-hidden. Copy comes from the caller's locale. */
|
|
30
|
+
statusLabels: Readonly<Record<TimelineStatus, string>>;
|
|
31
|
+
/** Groups in display order; ordering and bucketing are the caller's. */
|
|
32
|
+
groups: ReadonlyArray<TimelineGroup>;
|
|
33
|
+
/** Extra class on the root element, for layout. */
|
|
34
|
+
className?: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Vertical run timeline: date-bucket groups,
|
|
38
|
+
* each an ordered list of entries with a status badge, title, grey meta line, optional message
|
|
39
|
+
* and a rail that runs continuously inside a group. Data-driven like antd's `items`; grouping,
|
|
40
|
+
* sorting, copy and time formatting stay with the caller. Upstream ships no Timeline.
|
|
41
|
+
*/
|
|
42
|
+
export declare function Timeline({ label, statusLabels, groups, className }: TimelineProps): import("react").JSX.Element;
|