@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +22 -0
  3. package/README.md +175 -2
  4. package/README.zh.md +176 -0
  5. package/THIRD_PARTY_NOTICES.md +42 -0
  6. package/UPSTREAM.md +56 -0
  7. package/dist/blocks.js +1582 -0
  8. package/dist/chunks/chunk-23KOEBWJ.js +104 -0
  9. package/dist/chunks/chunk-3HCOU44R.js +697 -0
  10. package/dist/chunks/chunk-5JXG4BHW.js +31 -0
  11. package/dist/chunks/chunk-5XDVPALS.js +61 -0
  12. package/dist/chunks/chunk-AY44MQMD.js +3052 -0
  13. package/dist/chunks/chunk-B3EEK7A2.js +408 -0
  14. package/dist/chunks/chunk-CEBTQO6W.js +24 -0
  15. package/dist/chunks/chunk-CI73NXA5.js +202 -0
  16. package/dist/chunks/chunk-CTQPGUZP.js +22 -0
  17. package/dist/chunks/chunk-F352IICS.js +57 -0
  18. package/dist/chunks/chunk-IOBKTEKP.js +144 -0
  19. package/dist/chunks/chunk-KETGFAOH.js +66 -0
  20. package/dist/chunks/chunk-LA3QDZYN.js +2777 -0
  21. package/dist/chunks/chunk-NE62SYOZ.js +89 -0
  22. package/dist/chunks/chunk-OQPH36OI.js +754 -0
  23. package/dist/chunks/chunk-QJKAQ6PO.js +155 -0
  24. package/dist/chunks/chunk-R6AUJQ3G.js +129 -0
  25. package/dist/chunks/chunk-RNVSCTW7.js +24 -0
  26. package/dist/chunks/chunk-RZOP2PFC.js +152 -0
  27. package/dist/chunks/chunk-TQU54HSM.js +112 -0
  28. package/dist/chunks/chunk-TUK6UGXM.js +36 -0
  29. package/dist/chunks/chunk-TZ7HRE6D.js +328 -0
  30. package/dist/chunks/chunk-VIH56PDF.js +57 -0
  31. package/dist/chunks/chunk-WUL523OW.js +27 -0
  32. package/dist/chunks/chunk-XX6MSZLS.js +261 -0
  33. package/dist/chunks/chunk-ZA47FP7C.js +7 -0
  34. package/dist/chunks/chunk-ZZNL5PWF.js +170 -0
  35. package/dist/icons.js +803 -0
  36. package/dist/index.js +1182 -0
  37. package/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  38. package/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  39. package/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  40. package/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  41. package/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  42. package/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  43. package/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  44. package/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  45. package/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  46. package/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  47. package/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  48. package/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  49. package/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  50. package/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  51. package/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  52. package/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  53. package/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  54. package/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  55. package/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  56. package/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  57. package/dist/katex.css +1 -0
  58. package/dist/katex.css.d.ts +2 -0
  59. package/dist/markdown.js +148 -0
  60. package/dist/meta.json +6876 -0
  61. package/dist/root-inputs.json +67 -0
  62. package/dist/seekbuddy-card.js +7 -0
  63. package/dist/seekbuddy-empty.js +8 -0
  64. package/dist/seekbuddy-internal/DangerButton.js +7 -0
  65. package/dist/seekbuddy-internal/Mark.js +7 -0
  66. package/dist/seekbuddy-internal/Message.js +10 -0
  67. package/dist/seekbuddy-internal/Pagination.js +9 -0
  68. package/dist/seekbuddy-internal/StatusBadge.js +7 -0
  69. package/dist/seekbuddy-internal/SubtleButton.js +7 -0
  70. package/dist/seekbuddy-internal/Switch.js +7 -0
  71. package/dist/seekbuddy-internal/Upload.js +7 -0
  72. package/dist/seekbuddy-internal/date/Calendar.js +8 -0
  73. package/dist/seekbuddy-internal/date/DatePicker.js +9 -0
  74. package/dist/seekbuddy-internal/date/DateRangePicker.js +9 -0
  75. package/dist/seekbuddy-internal/date/TimePicker.js +8 -0
  76. package/dist/seekbuddy-internal/date/fields.js +16 -0
  77. package/dist/seekbuddy-internal/qr/QrCode.js +7 -0
  78. package/dist/seekbuddy-spinner.js +7 -0
  79. package/dist/seekbuddy-tabs.js +7 -0
  80. package/dist/seekbuddy-timeline.js +8 -0
  81. package/dist/seekbuddy.js +89 -0
  82. package/dist/theme-bootstrap.js +13 -0
  83. package/dist/theme.js +37 -0
  84. package/dist/tokens.css +934 -0
  85. package/dist/tokens.css.d.ts +2 -0
  86. package/dist/types/Button.d.ts +18 -0
  87. package/dist/types/Checkbox.d.ts +19 -0
  88. package/dist/types/CodeFileIcon.d.ts +11 -0
  89. package/dist/types/CodeToolbar.d.ts +29 -0
  90. package/dist/types/ConfigField.d.ts +32 -0
  91. package/dist/types/ConnectionIndicator.d.ts +25 -0
  92. package/dist/types/DiffBlock.d.ts +51 -0
  93. package/dist/types/DisclosureRow.d.ts +35 -0
  94. package/dist/types/FileTypeIcon.d.ts +42 -0
  95. package/dist/types/FoldToggle.d.ts +19 -0
  96. package/dist/types/HoverCard.d.ts +36 -0
  97. package/dist/types/ImageLightbox.d.ts +26 -0
  98. package/dist/types/ImagePreview.d.ts +11 -0
  99. package/dist/types/Input.d.ts +11 -0
  100. package/dist/types/JsonTree.d.ts +58 -0
  101. package/dist/types/LinkIcon.d.ts +33 -0
  102. package/dist/types/Menu.d.ts +142 -0
  103. package/dist/types/MenuGroup.d.ts +21 -0
  104. package/dist/types/MenuSurface.d.ts +15 -0
  105. package/dist/types/Modal.d.ts +43 -0
  106. package/dist/types/PermissionIcon.d.ts +38 -0
  107. package/dist/types/Pill.d.ts +12 -0
  108. package/dist/types/ReadBlock.d.ts +47 -0
  109. package/dist/types/ReferenceIcon.d.ts +20 -0
  110. package/dist/types/RiskConfirmation.d.ts +19 -0
  111. package/dist/types/SearchBlock.d.ts +71 -0
  112. package/dist/types/SegmentedControl.d.ts +34 -0
  113. package/dist/types/SegmentedTabs.d.ts +25 -0
  114. package/dist/types/ShortcutKeys.d.ts +10 -0
  115. package/dist/types/SiteGlyph.d.ts +24 -0
  116. package/dist/types/StateDot.d.ts +19 -0
  117. package/dist/types/Switch.d.ts +19 -0
  118. package/dist/types/Tag.d.ts +31 -0
  119. package/dist/types/TerminalBlock.d.ts +77 -0
  120. package/dist/types/TextShimmer.d.ts +22 -0
  121. package/dist/types/Toast.d.ts +48 -0
  122. package/dist/types/Tooltip.d.ts +63 -0
  123. package/dist/types/WebBlock.d.ts +60 -0
  124. package/dist/types/ansi.d.ts +16 -0
  125. package/dist/types/blocks.d.ts +19 -0
  126. package/dist/types/clipboard.d.ts +8 -0
  127. package/dist/types/code-file-icon-artwork.d.ts +53 -0
  128. package/dist/types/code-file-types.d.ts +29 -0
  129. package/dist/types/code-highlighting.d.ts +11 -0
  130. package/dist/types/css-modules.d.ts +6 -0
  131. package/dist/types/darwin-desktop.d.ts +8 -0
  132. package/dist/types/file-size.d.ts +7 -0
  133. package/dist/types/focus.d.ts +8 -0
  134. package/dist/types/guide-artwork.d.ts +14 -0
  135. package/dist/types/head-tail-cap.d.ts +22 -0
  136. package/dist/types/icons/index.d.ts +384 -0
  137. package/dist/types/icons/props.d.ts +8 -0
  138. package/dist/types/icons/shared-artwork.d.ts +42 -0
  139. package/dist/types/icons.d.ts +6 -0
  140. package/dist/types/index.d.ts +53 -0
  141. package/dist/types/input-modality.d.ts +18 -0
  142. package/dist/types/keyboard-composition.d.ts +10 -0
  143. package/dist/types/markdown/CodeBlock.d.ts +34 -0
  144. package/dist/types/markdown/JsonBlock.d.ts +7 -0
  145. package/dist/types/markdown/MarkdownDelegate.d.ts +45 -0
  146. package/dist/types/markdown/MarkdownText.d.ts +47 -0
  147. package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
  148. package/dist/types/markdown/file-link.d.ts +12 -0
  149. package/dist/types/markdown/highlight.d.ts +147 -0
  150. package/dist/types/markdown/incremental.d.ts +79 -0
  151. package/dist/types/markdown/katex.d.ts +18 -0
  152. package/dist/types/markdown/local-image-syntax.d.ts +9 -0
  153. package/dist/types/markdown/mathCompatibility.d.ts +10 -0
  154. package/dist/types/markdown/parse.d.ts +24 -0
  155. package/dist/types/markdown/plain-text.d.ts +21 -0
  156. package/dist/types/markdown/render.d.ts +140 -0
  157. package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
  158. package/dist/types/markdown.d.ts +9 -0
  159. package/dist/types/overlay-top-margin.d.ts +7 -0
  160. package/dist/types/plugin-artwork.d.ts +16 -0
  161. package/dist/types/pointer-grace.d.ts +21 -0
  162. package/dist/types/rank-by-name.d.ts +21 -0
  163. package/dist/types/relative-time.d.ts +22 -0
  164. package/dist/types/seekbuddy/Card.d.ts +28 -0
  165. package/dist/types/seekbuddy/DangerButton.d.ts +31 -0
  166. package/dist/types/seekbuddy/Empty.d.ts +34 -0
  167. package/dist/types/seekbuddy/Mark.d.ts +27 -0
  168. package/dist/types/seekbuddy/Message.d.ts +52 -0
  169. package/dist/types/seekbuddy/Pagination.d.ts +66 -0
  170. package/dist/types/seekbuddy/Spinner.d.ts +20 -0
  171. package/dist/types/seekbuddy/StatusBadge.d.ts +33 -0
  172. package/dist/types/seekbuddy/SubtleButton.d.ts +30 -0
  173. package/dist/types/seekbuddy/Switch.d.ts +36 -0
  174. package/dist/types/seekbuddy/Tabs.d.ts +49 -0
  175. package/dist/types/seekbuddy/Timeline.d.ts +42 -0
  176. package/dist/types/seekbuddy/Upload.d.ts +101 -0
  177. package/dist/types/seekbuddy/date/Calendar.d.ts +94 -0
  178. package/dist/types/seekbuddy/date/DatePicker.d.ts +29 -0
  179. package/dist/types/seekbuddy/date/DateRangePicker.d.ts +41 -0
  180. package/dist/types/seekbuddy/date/TimePicker.d.ts +35 -0
  181. package/dist/types/seekbuddy/date/date.d.ts +79 -0
  182. package/dist/types/seekbuddy/date/fields.d.ts +45 -0
  183. package/dist/types/seekbuddy/index.d.ts +49 -0
  184. package/dist/types/seekbuddy/qr/QrCode.d.ts +37 -0
  185. package/dist/types/seekbuddy/qr/qr.d.ts +38 -0
  186. package/dist/types/theme-bootstrap.d.ts +3 -0
  187. package/dist/types/theme-core.d.ts +14 -0
  188. package/dist/types/theme.d.ts +4 -0
  189. package/dist/types/use-copy-feedback.d.ts +13 -0
  190. package/dist/types/useAnchoredMaxHeight.d.ts +13 -0
  191. package/dist/types/useAnchoredPosition.d.ts +35 -0
  192. package/dist/types/useDismissOnOutsidePointer.d.ts +10 -0
  193. package/dist/types/useModalLayer.d.ts +26 -0
  194. package/dist/types/user-text.d.ts +36 -0
  195. package/package.json +151 -4
@@ -0,0 +1,2 @@
1
+ declare const css: string
2
+ export default css
@@ -0,0 +1,18 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ /** Visual variant, each backed by its --dsw-alias-button-* token family. */
3
+ export type ButtonVariant = 'primary' | 'ghost' | 'outline' | 'toolbar';
4
+ /**
5
+ * Render a button.
6
+ * @param props.variant - visual family (default 'ghost').
7
+ * @param props.size - 'md' 36px control with 12px corners or 'sm' 28px control with 8px corners.
8
+ * @param props.icon - optional leading 16px icon node.
9
+ * @param ref - native button for focus management and overlay anchors.
10
+ * @returns the button element; native button attributes pass through.
11
+ */
12
+ export declare const Button: import("react").ForwardRefExoticComponent<{
13
+ variant?: ButtonVariant;
14
+ size?: 'md' | 'sm';
15
+ icon?: ReactNode;
16
+ className?: string | undefined;
17
+ children?: ReactNode;
18
+ } & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,19 @@
1
+ /** Controlled native checkbox with a caller-owned visible and accessible label. */
2
+ /**
3
+ * Render a labeled checkbox with native keyboard and form semantics.
4
+ * @param props.checked - current checked state.
5
+ * @param props.onChange - receives the requested checked state.
6
+ * @param props.label - localized visible and accessible label.
7
+ * @param props.disabled - whether the control refuses changes.
8
+ * @param props.title - optional localized hover text.
9
+ * @param props.className - extra class for the label's placement.
10
+ * @returns the label containing its checkbox.
11
+ */
12
+ export declare function Checkbox({ checked, onChange, label, disabled, title, className, }: {
13
+ checked: boolean;
14
+ onChange: (next: boolean) => void;
15
+ label: string;
16
+ disabled?: boolean;
17
+ title?: string | undefined;
18
+ className?: string | undefined;
19
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IconProps } from './icons/props.js';
3
+ import type { CodeFileType } from './code-file-types.js';
4
+ /**
5
+ * Render one full-color square code-file glyph from the embedded icon set.
6
+ * @param props - Detailed code type, optional size, and optional CSS class.
7
+ * @returns The selected decorative SVG with its identifying palette intact.
8
+ */
9
+ export declare function CodeFileIcon({ type, size, className }: IconProps & {
10
+ readonly type: CodeFileType;
11
+ }): ReactNode;
@@ -0,0 +1,29 @@
1
+ /** Localized language fallback and wrapping actions supplied by the card owner. */
2
+ export interface CodeToolbarLabels {
3
+ /** Title for an absent or unsupported language. */
4
+ codeLabel: string;
5
+ /** Action that enables wrapping. */
6
+ wrapLabel: string;
7
+ /** Action that preserves source columns with horizontal scrolling. */
8
+ unwrapLabel: string;
9
+ }
10
+ /** Display state and callbacks for a code card's toolbar. */
11
+ interface CodeToolbarProps {
12
+ lang?: string | undefined;
13
+ title?: string | undefined;
14
+ status?: string | undefined;
15
+ labels: CodeToolbarLabels;
16
+ copyLabel: string;
17
+ copiedLabel: string;
18
+ copied: boolean;
19
+ wrapped: boolean;
20
+ onCopy?: (() => void) | undefined;
21
+ onWrap?: (() => void) | undefined;
22
+ }
23
+ /**
24
+ * Render a language label and keyboard-accessible icon actions with tooltips.
25
+ * @param props - Localized labels, current state, and card-owned actions.
26
+ * @returns The shared code-card header.
27
+ */
28
+ export declare function CodeToolbar({ lang, title, status, labels, copyLabel, copiedLabel, copied, wrapped, onCopy, onWrap, }: CodeToolbarProps): import("react").JSX.Element;
29
+ export {};
@@ -0,0 +1,32 @@
1
+ /** Field state and localized controls supplied by the owning form. */
2
+ export interface ConfigFieldProps {
3
+ /** Display label from the owning plugin. */
4
+ label: string;
5
+ /** Editable text; containers may use JSON. */
6
+ value: string;
7
+ /** Hide the input text and disable browser password autofill. */
8
+ secret: boolean;
9
+ /** Finite choices; an empty list uses a text control. */
10
+ choices: readonly string[];
11
+ /** Whether the field is currently read-only. */
12
+ disabled: boolean;
13
+ /** Whether the field has a user override. */
14
+ overridden: boolean;
15
+ /** Whether the draft fails validation. */
16
+ invalid: boolean;
17
+ /** Localized reset, inherited-value choice, and validation text. */
18
+ labels: {
19
+ reset: string;
20
+ inherited: string;
21
+ invalid: string;
22
+ };
23
+ /** Stage a new text value. */
24
+ onChange: (value: string) => void;
25
+ /** Stage removal of the user override. */
26
+ onReset: () => void;
27
+ }
28
+ /** Render a field without owning its schema, draft, or persistence.
29
+ * @param props Controlled field state and actions.
30
+ * @returns A labelled input with reset and validation feedback.
31
+ */
32
+ export declare function ConfigField(props: ConfigFieldProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ /** Visual state rendered by {@link ConnectionIndicator}. */
2
+ export type ConnectionIndicatorState = 'disconnected' | 'connecting' | 'recovered';
3
+ /**
4
+ * Render an inline connection-recovery control. The outage and retry-attempt
5
+ * states are one button whose static label already names the retry action;
6
+ * clicking it requests an immediate reconnect. The indicator animates in on
7
+ * appearance and fades out for {@link EXIT_MS} before unmounting.
8
+ * @param props.state - visible outage, retry-attempt, or recovered state.
9
+ * @param props.disconnectedLabel - localized outage text naming the retry action.
10
+ * @param props.connectingLabel - localized retry text followed by the attempt dots.
11
+ * @param props.recoveredLabel - localized recovery confirmation.
12
+ * @param props.reconnectActionLabel - accessible label for the outage action.
13
+ * @param props.restartActionLabel - accessible label for replacing an active attempt.
14
+ * @param props.onReconnect - request an immediate reconnect attempt.
15
+ * @returns the indicator, or null when no connection feedback is active.
16
+ */
17
+ export declare function ConnectionIndicator({ state, disconnectedLabel, connectingLabel, recoveredLabel, reconnectActionLabel, restartActionLabel, onReconnect, }: {
18
+ state: ConnectionIndicatorState | undefined;
19
+ disconnectedLabel: string;
20
+ connectingLabel: string;
21
+ recoveredLabel: string;
22
+ reconnectActionLabel: string;
23
+ restartActionLabel: string;
24
+ onReconnect: () => void;
25
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,51 @@
1
+ import { type CodeToolbarLabels } from './CodeToolbar.js';
2
+ /** Output lines shown before the height cap collapses the middle. */
3
+ export declare const DEFAULT_DIFF_MAX_LINES = 16;
4
+ /**
5
+ * One file change in the form {@link DiffBlock} renders. It is declared here
6
+ * so this primitive stays independent of the tool contract.
7
+ */
8
+ export interface DiffHunk {
9
+ /** The changed file's path, drawn verbatim as the hunk's header (the tool's model-facing path). */
10
+ path: string;
11
+ /** Prior content including context, or `null` when no prior content is available. */
12
+ oldText: string | null;
13
+ /** Content after the change, including any shared context. */
14
+ newText: string;
15
+ }
16
+ export interface DiffBlockProps {
17
+ /** One entry per applied hunk, in file order; empty renders nothing. */
18
+ diffs: DiffHunk[];
19
+ /** Localized chrome supplied by the owning render site. */
20
+ labels: DiffBlockLabels;
21
+ /** Height cap in body lines before the middle collapses (default {@link DEFAULT_DIFF_MAX_LINES}). */
22
+ maxLines?: number | undefined;
23
+ /** Extra class merged onto the wrapper (callers position; this component draws). */
24
+ className?: string | undefined;
25
+ }
26
+ /** Localized chrome for {@link DiffBlock}. */
27
+ export interface DiffBlockLabels extends CodeToolbarLabels {
28
+ copy: string;
29
+ copied: string;
30
+ collapseAria: string;
31
+ expandAria: (hidden: number) => string;
32
+ collapse: string;
33
+ expand: (hidden: number) => string;
34
+ }
35
+ /**
36
+ * Count displayed additions and deletions. Exact patches exclude shared context;
37
+ * comparisons exceeding the edit limit count both complete fragments as replaced.
38
+ * Text follows {@link contentLines}'s terminator rule.
39
+ * @param diffs - the hunks to count.
40
+ * @returns the +/- totals for tool summaries.
41
+ */
42
+ export declare function diffTotals(diffs: DiffHunk[]): {
43
+ added: number;
44
+ removed: number;
45
+ };
46
+ /**
47
+ * Render a file mutation as an inline diff surface.
48
+ * @param props - see {@link DiffBlockProps}.
49
+ * @returns the diff block element.
50
+ */
51
+ export declare function DiffBlock({ diffs, labels, maxLines, className }: DiffBlockProps): import("react").JSX.Element | null;
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from 'react';
2
+ /** Shared 24px process row: tertiary text and icons, secondary on hover. */
3
+ export interface DisclosureRowProps {
4
+ icon: ReactNode;
5
+ title: string;
6
+ open: boolean;
7
+ expandable: boolean;
8
+ onToggle: () => void;
9
+ /** Animate the complete header while its owning operation is running. */
10
+ running?: boolean | undefined;
11
+ /** Makes the complete title row the disclosure target. */
12
+ expandOnRowClick?: boolean | undefined;
13
+ /** Replaces the collapsed icon with a chevron while the row is hovered. */
14
+ previewChevron?: boolean | undefined;
15
+ /** Keeps `collapsedContent` inline while open. */
16
+ keepContentWhenOpen?: boolean | undefined;
17
+ collapsedContent?: ReactNode;
18
+ children?: ReactNode;
19
+ className?: string | undefined;
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;
25
+ leadingClassName?: string | undefined;
26
+ chevronClassName?: string | undefined;
27
+ titleClassName?: string | undefined;
28
+ }
29
+ /**
30
+ * Render one disclosure header and its controlled expanded content.
31
+ * Shallow prop comparison requires stable callbacks and React nodes to skip unchanged renders.
32
+ * @param props - Visual content, controlled state, and interaction policy.
33
+ * @returns the disclosure row.
34
+ */
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>;
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type CodeFileType, type FileTypeProjectContext } from './code-file-types.js';
3
+ import type { IconProps } from './icons/props.js';
4
+ /** File categories with distinct 28px glyphs. */
5
+ export type FileType = CodeFileType | 'code' | 'excel' | 'folder' | 'html' | 'image' | 'markdown' | 'other' | 'pdf' | 'ppt' | 'video' | 'word';
6
+ /** Compatibility name for consumers that pass an already resolved category. */
7
+ export type FileTypeKind = FileType;
8
+ type ClassifiedFileType = Exclude<FileType, 'folder'>;
9
+ export type { CodeFileType, FileTypeProjectContext } from './code-file-types.js';
10
+ /** Props for {@link FileTypeIcon}: either a path to classify or an already resolved kind. */
11
+ export type FileTypeIconProps = IconProps & ({
12
+ /** File path or name to classify. */
13
+ readonly path: string;
14
+ /** Optional project-file snapshot for context-sensitive code icons such as Flutter. */
15
+ readonly context?: FileTypeProjectContext | undefined;
16
+ } | {
17
+ /** Explicit category for callers that already resolved the file type. */
18
+ readonly kind: FileTypeKind;
19
+ });
20
+ /**
21
+ * Extract the final suffix from a file path without changing its case.
22
+ * A leading dot starts a suffix, while a missing or trailing dot returns an empty string.
23
+ * @param path - File path or basename using either path separator.
24
+ * @returns The characters after the basename's final dot.
25
+ */
26
+ export declare function fileExtension(path: string): string;
27
+ /**
28
+ * Classify a file path or name for file-card presentation.
29
+ * Matching is case-insensitive and applies code filename rules before extension rules;
30
+ * unknown names fall back to `other`.
31
+ * @param path - File path or basename using either path separator.
32
+ * @param context - Optional project files used by context-sensitive code mappings.
33
+ * @returns The file's closed presentation category.
34
+ */
35
+ export declare function classifyFileType(path: string, context?: FileTypeProjectContext): ClassifiedFileType;
36
+ /**
37
+ * Render a decorative file-type glyph for a path or an explicitly resolved kind.
38
+ * @param props - Path or kind selection, optional project context, size, and CSS class.
39
+ * @returns The category-colored SVG; the caller owns the accessible name and may override
40
+ * the color through `--dsh-file-type-icon-color`.
41
+ */
42
+ export declare function FileTypeIcon(props: FileTypeIconProps): ReactNode;
@@ -0,0 +1,19 @@
1
+ interface FoldToggleProps {
2
+ className: string | undefined;
3
+ expanded: boolean;
4
+ hidden: number;
5
+ labels: {
6
+ collapseAria: string;
7
+ expandAria: (hidden: number) => string;
8
+ collapse: string;
9
+ expand: (hidden: number) => string;
10
+ };
11
+ onToggle: () => void;
12
+ }
13
+ /**
14
+ * Render the shared head-tail fold control with caller-owned localized copy.
15
+ * @param props - Fold state, localized labels, and toggle callback.
16
+ * @returns The accessible expand or collapse button.
17
+ */
18
+ export declare function FoldToggle({ className, expanded, hidden, labels, onToggle }: FoldToggleProps): import("react").JSX.Element;
19
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ /**
3
+ * Render an anchor with a hover-triggered preview card, hidden while a tooltip within the anchor is visible.
4
+ * @param props.anchor - the hover target (rendered in place inside a wrapper span).
5
+ * @param props.content - card content; the pointer may rest on it, so it is
6
+ * readable and selectable, but it carries no dismissal affordance of its own.
7
+ * @param props.openDelayMs - hover dwell before the card shows (default 500).
8
+ * @param props.variant - compact card beside the anchor, or a preview above/below it
9
+ * with 24px side insets, a 420px height cap, frame-top clearance, and 100ms opacity transitions.
10
+ * @param props.widthAnchorRef - optional element whose width and horizontal position size the preview.
11
+ * @param props.inline - keep the anchor in prose; show a contained preview on hover or keyboard focus.
12
+ * @param props.disabled - suppress opening; turning true dismisses an open card.
13
+ * @param props.copyText - optional primary value copied by activation and
14
+ * included in the card's accessible name.
15
+ * @param props.copyLabel - localized accessible activation-label prefix.
16
+ * @param props.copiedLabel - localized visible success label.
17
+ * @returns anchor wrapper with the conditional portaled card.
18
+ */
19
+ export declare function HoverCard({ anchor, content, openDelayMs, disabled, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, }: {
20
+ anchor: ReactNode;
21
+ /** Inline media preview using the shared menu material and keyboard focus. */
22
+ inline?: boolean;
23
+ content: ReactNode;
24
+ openDelayMs?: number;
25
+ disabled?: boolean;
26
+ variant?: 'compact' | 'preview';
27
+ widthAnchorRef?: RefObject<HTMLElement | null>;
28
+ } & ({
29
+ copyText?: string | undefined;
30
+ copyLabel: string;
31
+ copiedLabel: string;
32
+ } | {
33
+ copyText?: undefined;
34
+ copyLabel?: string;
35
+ copiedLabel?: string;
36
+ })): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ /** Lightbox strings the owner resolves from its own locale namespace. */
2
+ export interface ImageLightboxLabels {
3
+ /** Accessible name of the preview dialog. */
4
+ dialog: string;
5
+ /** Accessible label of the close control. */
6
+ close: string;
7
+ }
8
+ /**
9
+ * Document-level original-image preview opened by clicking a thumbnail.
10
+ * Closes on Escape, backdrop press, or the close control, and restores focus
11
+ * to the opener on unmount. Rendered through a body portal: an opener inside
12
+ * a transformed or filtered ancestor would otherwise trap the fixed backdrop
13
+ * in that ancestor's box instead of covering the viewport.
14
+ *
15
+ * @param props.src - the original image URL.
16
+ * @param props.alt - the image's alt text.
17
+ * @param props.labels - dialog and close-control strings.
18
+ * @param props.onClose - dismiss callback owned by the opener.
19
+ * @returns the modal preview dialog.
20
+ */
21
+ export declare function ImageLightbox({ src, alt, labels, onClose, }: {
22
+ src: string;
23
+ alt: string;
24
+ labels: ImageLightboxLabels;
25
+ onClose: () => void;
26
+ }): import("react").ReactPortal;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Render an image without introducing a second activation target.
3
+ * @param props - Source, accessible description, localized status.
4
+ * @returns A contained preview with loading or failure status.
5
+ */
6
+ export declare function ImagePreview({ src, alt, loadingLabel, failedLabel, }: {
7
+ src: string;
8
+ alt: string;
9
+ loadingLabel: string;
10
+ failedLabel: string;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from 'react';
2
+ /**
3
+ * Render a text input with an optional leading icon.
4
+ * @param props.icon - optional 16px leading icon node.
5
+ * @param ref - the native input, cleared when it unmounts.
6
+ * @returns wrapper span containing the native input; input attributes pass through.
7
+ */
8
+ export declare const Input: import("react").ForwardRefExoticComponent<{
9
+ icon?: ReactNode;
10
+ className?: string;
11
+ } & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Display copy for the tree's copy affordance; the owner passes localized
3
+ * labels (this package is cordis-free, so copy arrives via props).
4
+ */
5
+ export interface JsonTreeLabels {
6
+ /** Menu item: copy the raw primitive value. */
7
+ copyValue: string;
8
+ /** Menu item: copy the value as compact JSON (primitive rows). */
9
+ copyJson: string;
10
+ /** Menu item: copy the property path. */
11
+ copyPath: string;
12
+ /** Menu item: copy the value as pretty-printed JSON. */
13
+ copyPrettyJson: string;
14
+ /** Menu item: copy the value as compact JSON (object rows). */
15
+ copyCompactJson: string;
16
+ /** Copy-button state label after a successful copy. */
17
+ copied: string;
18
+ /** Copy-button state label after a failed copy. */
19
+ copyFailed: string;
20
+ /** Expander aria label while expanded. */
21
+ collapseNode: string;
22
+ /** Expander aria label while collapsed. */
23
+ expandNode: string;
24
+ /** Copy-button tooltip, given the current action label. */
25
+ copyButtonTitle: (action: string) => string;
26
+ }
27
+ /** Props for the read-only, token-themed JSON tree. */
28
+ export interface JsonTreeProps {
29
+ /** Parsed JSON object or array. */
30
+ data: object | unknown[];
31
+ /** Accessible label for the tree. */
32
+ label: string;
33
+ /** Optional positioning class owned by the caller. */
34
+ className?: string | undefined;
35
+ /** Maximum visible lines per collapsed string; defaults to 3. */
36
+ collapsedStringLines?: number;
37
+ /** Optional wrap toggle; each expansion reads the shared default without changing other open strings. */
38
+ stringWrapping?: {
39
+ /** Localized label for the wrapping toggle. */
40
+ label: string;
41
+ /** Read the wrapping preference when a string is expanded. @returns Whether to wrap long lines. */
42
+ getDefault: () => boolean;
43
+ /** Remember a user toggle for future expansions. @param wrapped - Whether to wrap long lines. */
44
+ setDefault: (wrapped: boolean) => void;
45
+ } | undefined;
46
+ /** Whether JSON rows expose copy actions. */
47
+ copyable?: boolean;
48
+ /** Whether the top-level object or array is always expanded. */
49
+ expandTopLevel?: boolean;
50
+ /** Localized display copy supplied by the owning render site. */
51
+ labels: JsonTreeLabels;
52
+ }
53
+ /**
54
+ * Render parsed JSON as a compact, keyboard-accessible inspector tree.
55
+ * @param props - Parsed data, accessible label, and display options.
56
+ * @returns A read-only JSON tree with an optionally fixed-open top level.
57
+ */
58
+ export declare function JsonTree({ data, label, className, collapsedStringLines, stringWrapping, copyable, expandTopLevel, labels, }: JsonTreeProps): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Leading current-color category glyphs for clickable artifact links. The
3
+ * public component keeps individual artwork private to the link vocabulary.
4
+ */
5
+ import type { ReactNode } from 'react';
6
+ import type { IconProps } from './icons/props.js';
7
+ /** Link categories with distinct leading glyphs. */
8
+ export type LinkIconKind = 'url' | 'folder' | 'code' | 'image' | 'document' | 'other';
9
+ /** Props for link icons: the category plus the shared icon sizing seat. */
10
+ export interface LinkIconProps extends IconProps {
11
+ kind: LinkIconKind;
12
+ /** Destination of a URL link; known HTTP(S) hosts render their site mark. */
13
+ href?: string | undefined;
14
+ }
15
+ /**
16
+ * Derive a file path's link-icon category from its extension. Unknown and
17
+ * missing extensions fall to `other` (the plain-paper glyph).
18
+ * @param path - File path as the producing tool spelled it (either separator).
19
+ * @returns The file's glyph category; never `url` or `folder`.
20
+ */
21
+ export declare function classifyLinkPath(path: string): LinkIconKind;
22
+ /**
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.
32
+ */
33
+ export declare function LinkIconMedium(props: LinkIconProps): ReactNode;
@@ -0,0 +1,142 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Selectable row (optionally with a nested submenu). */
3
+ export interface MenuItem {
4
+ id: string;
5
+ label: ReactNode;
6
+ disabled?: boolean;
7
+ /** Effective binding supplied by the command owner; omitted for unbound actions. */
8
+ shortcut?: {
9
+ keys: readonly string[];
10
+ aria?: string | undefined;
11
+ };
12
+ /** Leading icon (figma .Menu_cell gap 8). */
13
+ icon?: ReactNode;
14
+ /** Destructive row: error-colored text/icon and danger hover fill. */
15
+ danger?: boolean;
16
+ /** Nested card opened to the right on hover/focus. */
17
+ submenu?: readonly MenuItem[];
18
+ }
19
+ /** Hairline between item groups (not selectable). */
20
+ export interface MenuSeparator {
21
+ type: 'separator';
22
+ id: string;
23
+ }
24
+ /** Non-interactive heading row above a group of items. */
25
+ export interface MenuLabel {
26
+ type: 'label';
27
+ id: string;
28
+ text: string;
29
+ }
30
+ /** One primary-menu entry: a row, a separator, or a heading label. */
31
+ export type MenuEntry = MenuItem | MenuSeparator | MenuLabel;
32
+ /** Props for one component-rendered menu row. */
33
+ export interface MenuItemButtonProps {
34
+ /** Visible row label. */
35
+ children: ReactNode;
36
+ /** Effective binding supplied by the command owner; omitted for unbound actions. */
37
+ shortcut?: MenuItem['shortcut'];
38
+ /** Leading icon (figma .Menu_cell gap 8). */
39
+ icon?: ReactNode;
40
+ /** Whether the row cannot be activated. */
41
+ disabled?: boolean;
42
+ /** Destructive row: error-colored text/icon and danger hover fill. */
43
+ danger?: boolean;
44
+ /**
45
+ * Start a new group: a hairline above this row, the same one a
46
+ * `{ type: 'separator' }` data entry draws. It comes and goes with the row,
47
+ * so a row that renders nothing leaves no stray line; a data separator
48
+ * directly before it draws no second line, and the list's first row draws none.
49
+ */
50
+ separatorBefore?: boolean;
51
+ /** Row activation (click, Enter, or Tab on the focused row). */
52
+ onSelect: () => void;
53
+ }
54
+ /**
55
+ * Render one `role="menuitem"` row for a {@link Menu} whose rows are
56
+ * components rather than `items` data: the same markup and styling as a data
57
+ * row, so it joins the list's keyboard walk and post-selection focus return
58
+ * without any shared state. Closing the menu stays the owner's decision, as
59
+ * it is for data rows.
60
+ * @param props.children - visible row label.
61
+ * @param props.shortcut - effective key labels and accessible combination.
62
+ * @param props.icon - optional leading icon.
63
+ * @param props.disabled - whether the row cannot be activated.
64
+ * @param props.danger - whether to use the destructive row colors.
65
+ * @param props.separatorBefore - whether this row starts a new group (hairline above it).
66
+ * @param props.onSelect - row activation callback.
67
+ * @returns one menu-item row.
68
+ */
69
+ export declare function MenuItemButton({ children, shortcut, icon, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
70
+ /**
71
+ * Render an anchored dropdown menu. While the list is open its keys mirror the
72
+ * composer's: Tab settles the focused row — from the trigger, Tab enters the
73
+ * list instead — and Escape or Shift+Tab close it and return focus to the
74
+ * anchor's first button, and selecting a row does the same — the rows unmount
75
+ * with the list. Only a keyboard on the trigger or inside the list is
76
+ * intercepted; Tab presses elsewhere on the page stay the browser's.
77
+ * @param props.autoFocus - focus the first item on open; the arrow keys walk the list either way.
78
+ * @param props.open - whether the list is showing (owner-controlled).
79
+ * @param props.anchor - the trigger element (rendered in place).
80
+ * @param props.items - selectable data rows and optional separators (default none; with no `children` either, the list is empty).
81
+ * @param props.selectedId - row shown as selected.
82
+ * @param props.selectedIds - rows shown as selected when a menu contains independent option groups.
83
+ * @param props.onSelect - data-row activation callback (not called for disabled rows or submenu parents that only open children).
84
+ * @param props.onClose - invoked on outside click, Escape, or a window blur
85
+ * that moved focus into an iframe (the only signal a pointerdown inside a
86
+ * cross-origin iframe leaves).
87
+ * @param props.align - list alignment against the anchor (default 'start').
88
+ * @param props.side - open below (`bottom`, default) or above (`top`) the anchor.
89
+ * @param props.portal - render the list into document.body, fixed-positioned
90
+ * from the anchor rect (follows movement and resizing while open). Use when an
91
+ * ancestor's overflow clipping would crop the in-place list; default false
92
+ * keeps the pure-CSS in-place behavior.
93
+ * @param props.closeOnPointerLeave - close the list once the pointer has left
94
+ * both trigger and list for the pointer grace (default false keeps it open
95
+ * until outside click/Escape/selection). The grace makes the 4px trigger->list
96
+ * gap and a brief overshoot survivable; coming back cancels the close.
97
+ * @param props.dense - reduce vertical row spacing without changing the standard typography or card width.
98
+ * @param props.compact - use reduced menu typography and spacing.
99
+ * @param props.getAnchorRect - portal mode only: supply the anchor rect
100
+ * directly (e.g. from a host-owned trigger button) instead of measuring the
101
+ * Menu's own wrapper span. Required when the wrapper isn't itself laid out at
102
+ * the trigger (render-prop anchors, effect-positioned proxies — measuring the
103
+ * wrapper there races the host's layout effects). Called on open, each animation
104
+ * frame, and scroll/resize; return null to skip placement for that frame.
105
+ * @param props.footer - rows pinned below the scrolling items area, separated
106
+ * by a hairline; they stay visible while the items above scroll.
107
+ * @param props.children - component rows rendered after `items` in the same
108
+ * list, each a `role="menuitem"` button such as {@link MenuItemButton}; they
109
+ * share the keyboard walk, the submenu exclusivity, and the post-selection
110
+ * focus return.
111
+ * @param props.selection - how a selected row is marked: a trailing check
112
+ * (`'check'`, default — figma .Menu_cell) or the hover fill held on the row
113
+ * with no check (`'fill'`, for icon-labelled rows where a trailing glyph
114
+ * crowds the cell).
115
+ * @param props.className - extra class on the anchor wrapper span.
116
+ * @param props.listClassName - extra class on the dropdown card itself; the
117
+ * only style hook that reaches a portaled list, which renders under
118
+ * document.body outside the owner's DOM subtree.
119
+ * @returns anchor wrapper with the conditional list.
120
+ */
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, }: {
122
+ open: boolean;
123
+ autoFocus?: boolean;
124
+ anchor: ReactNode;
125
+ items?: readonly MenuEntry[];
126
+ children?: ReactNode;
127
+ footer?: readonly MenuEntry[];
128
+ selectedId?: string | undefined;
129
+ selectedIds?: readonly string[] | undefined;
130
+ onSelect?: (id: string) => void;
131
+ onClose: () => void;
132
+ align?: 'start' | 'end';
133
+ side?: 'bottom' | 'top' | 'right';
134
+ portal?: boolean;
135
+ closeOnPointerLeave?: boolean;
136
+ dense?: boolean;
137
+ compact?: boolean;
138
+ selection?: 'check' | 'fill';
139
+ getAnchorRect?: () => DOMRect | null;
140
+ className?: string | undefined;
141
+ listClassName?: string | undefined;
142
+ }): import("react").JSX.Element;
@@ -0,0 +1,21 @@
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;