@declarion/react 0.1.75 → 0.1.76

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Convert markdown source to a single-line plain-text preview. Whitespace is
3
+ * collapsed; block boundaries (paragraphs, list items, table cells) become
4
+ * single spaces. No length cap — server-side `list_preview` already bounds
5
+ * the wire payload, and the calling cell's CSS ellipsis bounds the visual.
6
+ */
7
+ export declare function markdownToPlainText(src: string): string;
8
+ /**
9
+ * Returns true when the parsed AST contains ONLY plain types
10
+ * (root / paragraph / text / break). In that case the popover would show a
11
+ * format that is visually equivalent to the in-cell span, so callers should
12
+ * skip the HoverCard and use a native title tooltip alone — no popover
13
+ * noise on prose that just happens to contain parens, asterisks-as-stars,
14
+ * or other characters that look markdown-ish but parse as text.
15
+ */
16
+ export declare function looksLikePlainText(src: string): boolean;
@@ -1,7 +1,8 @@
1
- import type { ReactNode } from "react";
1
+ import type { ReactElement } from "react";
2
2
  import type { EntityField, Entity, Screen } from "../../../types/schema";
3
3
  export type RowRecord = Record<string, unknown>;
4
- export type CellRenderer = (value: unknown, record: RowRecord) => ReactNode;
4
+ export type CellOutput = string | number | ReactElement;
5
+ export type CellRenderer = (value: unknown, record: RowRecord) => CellOutput;
5
6
  export type RefsMap = Record<string, Record<string, Record<string, unknown>>>;
6
7
  export interface CellResolveCtx {
7
8
  field: EntityField;
@@ -0,0 +1,15 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+ export type HoverCardAlign = "start" | "center" | "end";
3
+ export type HoverCardProps = {
4
+ /** The card body shown on hover. Caller controls the rendered content. */
5
+ content: ReactNode;
6
+ /** The trigger node. Wrapped in an inline span. */
7
+ children: ReactNode;
8
+ /** Card width in pixels. Default 320. */
9
+ width?: number;
10
+ /** Horizontal alignment relative to the anchor. Default `center`. */
11
+ align?: HoverCardAlign;
12
+ /** Optional inline style overrides on the card body. */
13
+ style?: CSSProperties;
14
+ };
15
+ export declare function HoverCard({ content, children, width, align, style, }: HoverCardProps): import("react/jsx-runtime").JSX.Element;
@@ -14,6 +14,8 @@ export { BrandGlyph } from "./BrandGlyph";
14
14
  export type { BrandGlyphProps } from "./BrandGlyph";
15
15
  export { Dropdown } from "./Dropdown";
16
16
  export type { DropdownProps } from "./Dropdown";
17
+ export { HoverCard } from "./HoverCard";
18
+ export type { HoverCardProps, HoverCardAlign } from "./HoverCard";
17
19
  export { Chip } from "./Chip";
18
20
  export type { ChipProps } from "./Chip";
19
21
  export { SectionCard } from "./SectionCard";