@mithrl/design-system 0.4.0 → 0.4.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.
@@ -0,0 +1,62 @@
1
+ import { type CSSProperties } from "react";
2
+
3
+ /**
4
+ * Milliseconds one swap takes. Both halves of the strip share it — see the
5
+ * stylesheet for why they cannot be decoupled. Mirrors `--motion-duration-slow`;
6
+ * the CSS reads the token directly and only falls back to this number when the
7
+ * caller overrides `revealDuration`.
8
+ */
9
+ export declare const TEXT_REVEAL_DEFAULT_DURATION_MS = 320;
10
+ export type TextRevealElement = "span" | "div" | "p" | "strong" | "em";
11
+ export type TextRevealAlign = "start" | "center" | "end";
12
+ export interface TextRevealProps {
13
+ /** The string to display. Changing it rolls the whole line over. */
14
+ text: string;
15
+ /** Host element. @default "span" */
16
+ as?: TextRevealElement;
17
+ /** Swap duration, in milliseconds. @default `--motion-duration-slow` */
18
+ revealDuration?: number;
19
+ /** Horizontal alignment of the rendered line. @default "start" */
20
+ align?: TextRevealAlign;
21
+ className?: string;
22
+ style?: CSSProperties;
23
+ }
24
+ /**
25
+ * Roller-style line transition.
26
+ *
27
+ * The line lives behind a one-line mask. When `text` changes the two lines move
28
+ * together as one rigid strip, downwards: the incoming line starts one line
29
+ * height *above* the window and slides down into place, while the outgoing line
30
+ * slides down and out through the bottom. New copy is revealed from the top,
31
+ * the way a station roller tag turns over.
32
+ *
33
+ * This is the transitions.dev "texts-reveal" technique — opacity, `translateY`
34
+ * and blur transitioned together on a smooth-out curve — kept strictly 2D. An
35
+ * earlier `rotateX` version could not survive a consumer that clips the label:
36
+ * each half collapsed into a sliver at its own hinge, so the flip never read as
37
+ * completing. A masked strip is both the sturdier mechanism and the closer
38
+ * match to the roller reference.
39
+ *
40
+ * Layout: the outgoing line is lifted out of flow and the mask is exactly one
41
+ * line tall, so the host's height never changes across a swap.
42
+ *
43
+ * Interruption: one swap is identified by a token. A `text` change mid-flight
44
+ * bumps the token, which re-keys both lines and restarts the animation from a
45
+ * known state — there is no partial transform to inherit. Settling is driven by
46
+ * the incoming line's `animationend` *and* by a token-guarded timer, so a
47
+ * dropped event or a throttled background tab still resolves to the settled
48
+ * DOM: exactly one line, no outgoing line, no transform.
49
+ *
50
+ * Accessibility: the visual lines are `aria-hidden`, the host carries
51
+ * `aria-label={text}`, and a visually hidden polite live region announces the
52
+ * settled string once.
53
+ *
54
+ * Reduced motion: no travel and no blur — the line crossfades in place.
55
+ */
56
+ export declare function TextReveal({ text, as, revealDuration, align, className, style, }: TextRevealProps): import("react").DetailedReactHTMLElement<{
57
+ className: string;
58
+ style: CSSProperties | undefined;
59
+ "aria-label": string;
60
+ "data-align": TextRevealAlign;
61
+ "data-revealing": string;
62
+ }, HTMLElement>;
package/dist/index.d.ts CHANGED
@@ -29,6 +29,8 @@ export { Textarea, textareaVariants } from "./components/textarea/Textarea";
29
29
  export type { TextareaPreviewState, TextareaProps, TextareaResize, TextareaStatus, TextareaSurface, } from "./components/textarea/Textarea";
30
30
  export { Composer } from "./components/composer/Composer";
31
31
  export type { ComposerLabels, ComposerMode, ComposerPreviewState, ComposerProps, ComposerStatus, } from "./components/composer/Composer";
32
+ export { ApprovalCard } from "./components/approval-card/ApprovalCard";
33
+ export type { ApprovalCardAnswer, ApprovalCardLabels, ApprovalCardMode, ApprovalCardNavigationReason, ApprovalCardOption, ApprovalCardProps, ApprovalCardQuestion, } from "./components/approval-card/ApprovalCard";
32
34
  export { ComposerViewTransition } from "./components/composer/ComposerViewTransition";
33
35
  export type { ComposerView, ComposerViewTransitionProps, } from "./components/composer/ComposerViewTransition";
34
36
  export { ComposerAttachmentView } from "./components/composer/ComposerAttachmentView";
@@ -97,24 +99,30 @@ export { WorkspaceQuestionSurface } from "./patterns/workspace-app-shell/Workspa
97
99
  export type { WorkspaceAppShellNavigationRenderContext, WorkspaceAppShellNavigationRenderer, WorkspaceAppShellLayout, WorkspaceAppShellProps, WorkspaceNavigationConfiguration, } from "./patterns/workspace-app-shell/WorkspaceAppShell";
98
100
  export type { WorkspaceNewQuestionDialogProps, WorkspaceNewQuestionDraft, } from "./patterns/workspace-app-shell/WorkspaceNewQuestionDialog";
99
101
  export type { WorkspaceQuestionSurfacePanel, WorkspaceQuestionSurfaceProps, WorkspaceQuestionSurfaceScroll, } from "./patterns/workspace-app-shell/WorkspaceQuestionSurface";
102
+ export { PIXEL_LOADER_DEFAULT_LABEL, PIXEL_LOADER_GRID, PixelLoader, pixelLoaderCellDelay, pixelLoaderCellPhase, pixelLoaderLitCellsAt, pixelLoaderVariants, } from "./components/pixel-loader/PixelLoader";
103
+ export type { PixelLoaderProps, PixelLoaderSize, PixelLoaderVariant, } from "./components/pixel-loader/PixelLoader";
104
+ export { DotField, dotFieldDistanceToRect, dotFieldExclusionAlpha, dotFieldFalloff, dotFieldInflateRect, } from "./components/dot-field/DotField";
105
+ export type { DotFieldProps, DotFieldRect, } from "./components/dot-field/DotField";
100
106
  export { StatusOrb } from "./components/status-orb/StatusOrb";
101
107
  export type { StatusOrbProps, StatusOrbSize, StatusOrbState, StatusOrbTheme, } from "./components/status-orb/StatusOrb";
102
108
  export { FlapText, FLAP_TEXT_DEFAULT_DURATION_MS, FLAP_TEXT_DEFAULT_STAGGER_MS, } from "./components/flap-text/FlapText";
103
109
  export type { FlapTextAlign, FlapTextElement, FlapTextProps, } from "./components/flap-text/FlapText";
110
+ export { TextReveal, TEXT_REVEAL_DEFAULT_DURATION_MS, } from "./components/text-reveal/TextReveal";
111
+ export type { TextRevealAlign, TextRevealElement, TextRevealProps, } from "./components/text-reveal/TextReveal";
104
112
  export { NumberFlow, numberFlowCells, NUMBER_FLOW_DEFAULT_DURATION_MS, NUMBER_FLOW_DEFAULT_STAGGER_MS, } from "./components/number-flow/NumberFlow";
105
113
  export type { NumberFlowCell, NumberFlowDirection, NumberFlowElement, NumberFlowProps, NumberFlowSize, } from "./components/number-flow/NumberFlow";
106
- export { ApprovalCard } from "./components/approval-card/ApprovalCard";
107
- export type { ApprovalAnswers, ApprovalCardProps, ApprovalOption, ApprovalQuestion, } from "./components/approval-card/ApprovalCard";
108
114
  export { CodeBlock } from "./components/code-block/CodeBlock";
109
115
  export type { CodeBlockLabels, CodeBlockProps, CodeBlockRenderLineArgs, CodeBlockVariant, CodeLine, CodeLineKind, } from "./components/code-block/CodeBlock";
110
116
  export { CommandSearch } from "./components/command-search/CommandSearch";
111
- export type { CommandSearchItem, CommandSearchProps, } from "./components/command-search/CommandSearch";
117
+ export type { CommandSearchItem, CommandSearchItemState, CommandSearchProps, } from "./components/command-search/CommandSearch";
112
118
  export { ContextCard, ContextCardList, FileTypeChip, } from "./components/context-cards/ContextCards";
113
119
  export type { ContextCardListProps, ContextCardProps, ContextFileType, FileTypeChipProps, } from "./components/context-cards/ContextCards";
114
120
  export { FilterTable, filterTableStatusLabels, filterTableStatuses, } from "./components/filter-table/FilterTable";
115
121
  export type { FilterTableProps, FilterTableRow, FilterTableStatus, FilterTableStatusLabelMap, } from "./components/filter-table/FilterTable";
116
- export { FlowchartAction, FlowchartCanvas, FlowchartCondition, FlowchartConnector, FlowchartTrigger, } from "./components/flowchart/Flowchart";
117
- export type { FlowchartActionProps, FlowchartCanvasProps, FlowchartClauseJoin, FlowchartConditionClause, FlowchartConditionProps, FlowchartConnectorProps, FlowchartConnectorVariant, FlowchartTriggerProps, } from "./components/flowchart/Flowchart";
122
+ export { FlowchartAction, FlowchartCanvas, FlowchartCondition, FlowchartConnector, FlowchartGraph, FlowchartTrigger, } from "./components/flowchart/Flowchart";
123
+ export type { FlowchartActionProps, FlowchartCanvasProps, FlowchartClauseJoin, FlowchartConditionClause, FlowchartConditionProps, FlowchartConnectorProps, FlowchartConnectorVariant, FlowchartGraphNode, FlowchartGraphProps, FlowchartTriggerProps, } from "./components/flowchart/Flowchart";
124
+ export { FLOWCHART_GRAPH_MAX_LANES, FLOWCHART_GRAPH_MAX_NODES, layoutFlowchartGraph, } from "./components/flowchart/graphLayout";
125
+ export type { FlowchartGraphEdge, FlowchartGraphLayout, FlowchartGraphNodeKind, } from "./components/flowchart/graphLayout";
118
126
  export { InsightCards } from "./components/insight-cards/InsightCards";
119
127
  export type { Insight, InsightCardsProps, InsightChart, InsightChartPoint, InsightComparison, InsightFollowUp, InsightSegment, InsightTone, } from "./components/insight-cards/InsightCards";
120
128
  export { PromptBar, readTriggerAtCaret, } from "./components/prompt-bar/PromptBar";