@cloudvoyant/helix 0.16.0 → 0.17.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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import { ClassValue } from 'clsx';
4
+ import * as ManimWeb from 'manim-web';
5
+ import { DomChartDefinition } from '@tanstack/charts';
4
6
 
5
7
  declare const buttonVariants: (props?: ({
6
8
  variant?: "solid" | "outline" | "text" | null | undefined;
@@ -435,4 +437,287 @@ declare function mermaidSvgAspectRatio(svg: string): string | undefined;
435
437
  */
436
438
  declare function renderMermaidSource(code: string): Promise<string>;
437
439
 
438
- export { type BadgeProps, type BadgeVariants, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type CheckboxProps, type CheckboxVariants, type ComboboxItemVariants, type ComboboxProps, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type MermaidProps, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NumberInputProps, type PageGutterContentVariants, type PageGutterVariants, type PageVariants, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SwitchProps, type SwitchVariants, THEMES, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeMeta, type ToggleButtonProps, type ToggleButtonVariants, badgeVariants, buttonVariants, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, cn, colBase, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogTitleBase, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, hstackBase, inputVariants, itemVariants, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, renderMermaidSource, resolveMermaidThemeVariables, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, sidebarMenuButtonVariants, sidebarStyles, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, toggleButtonVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, vstackBase, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase };
440
+ /** Ghost icon-button styling for a copy trigger, reused by the code-block family. */
441
+ declare const clipboardTriggerBase = "inline-flex h-7 w-7 shrink-0 items-center justify-center gap-1.5 rounded-md text-xs text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-3.5 [&_svg]:shrink-0";
442
+
443
+ declare const radioGroupRootBase = "flex flex-col gap-2";
444
+ declare const radioGroupItemControlBase = "relative inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input bg-transparent shadow-xs transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:ring-offset-1 focus-visible:ring-offset-background data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24 data-[state=checked]:border-primary data-[state=checked]:text-primary disabled:pointer-events-none disabled:opacity-50";
445
+ declare const radioGroupItemTextBase = "select-none text-sm font-medium leading-none";
446
+
447
+ declare const noticeVariants: (props?: ({
448
+ variant?: "success" | "info" | "none" | "warning" | "error" | null | undefined;
449
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
450
+ type NoticeVariants = VariantProps<typeof noticeVariants>;
451
+ declare const noticeTitleBase = "col-start-2 min-h-4 font-semibold tracking-tight";
452
+ declare const noticeDescriptionBase = "col-start-2 text-sm text-foreground [&_p]:leading-relaxed";
453
+ interface NoticeProps {
454
+ variant?: NoticeVariants['variant'];
455
+ title?: string;
456
+ className?: string;
457
+ }
458
+
459
+ declare const figureRootBase = "not-prose my-4 flex flex-col items-center";
460
+ declare const figureImageBase = "rounded-lg border border-border";
461
+ declare const figureCaptionBase = "mt-2 text-center text-sm text-muted-foreground";
462
+ interface FigureProps {
463
+ src?: string;
464
+ alt?: string;
465
+ caption?: string;
466
+ className?: string;
467
+ }
468
+
469
+ declare const revealRootBase = "not-prose my-4 overflow-hidden rounded-lg border border-border bg-muted/40";
470
+ declare const revealTriggerBase = "flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-sm font-semibold";
471
+ declare const revealChevronBase = "size-4 shrink-0 text-muted-foreground transition-transform duration-200 data-[state=open]:rotate-90";
472
+ declare const revealContentBase = "border-t border-border px-3 py-2.5 text-sm text-foreground";
473
+ interface RevealProps {
474
+ question: string;
475
+ className?: string;
476
+ }
477
+
478
+ declare const prevNextRootBase = "not-prose mt-8 flex flex-col gap-3 border-t border-border pt-6 sm:flex-row sm:justify-between";
479
+ declare const prevNextLinkBase = "group flex min-w-0 flex-1 flex-col rounded-lg border border-border px-4 py-3 no-underline transition-colors hover:border-primary";
480
+ declare const prevNextLinkNextBase = "items-end text-right";
481
+ declare const prevNextDirectionBase = "text-xs font-medium text-muted-foreground";
482
+ declare const prevNextTitleBase = "truncate text-sm font-medium text-foreground transition-colors group-hover:text-primary";
483
+ declare const prevNextSpacerBase = "flex-1";
484
+ interface PrevNextProps {
485
+ prev?: {
486
+ title: string;
487
+ href: string;
488
+ };
489
+ next?: {
490
+ title: string;
491
+ href: string;
492
+ };
493
+ className?: string;
494
+ }
495
+
496
+ declare const latexRootBase = "not-prose";
497
+ declare const latexDisplayBase = "my-4 block w-full overflow-x-auto py-1";
498
+ declare const latexInlineBase = "inline-block align-middle";
499
+ declare const latexErrorBase = "font-mono text-sm text-destructive";
500
+ interface LaTeXProps {
501
+ /** LaTeX source. */
502
+ latex: string;
503
+ /** Pre-rendered KaTeX HTML for the static/server path. When provided the component renders it
504
+ * immediately and never calls `katex` — a rehype-katex-style plugin can pass its output here. */
505
+ html?: string;
506
+ /** Extra classes for the root container. */
507
+ className?: string;
508
+ }
509
+ /**
510
+ * Render LaTeX to KaTeX HTML synchronously. `katex` is a hard dependency, so this works at
511
+ * build/SSR time (a rehype plugin or `renderToStaticMarkup` path) and on the client alike —
512
+ * no lazy import, no placeholder, no double render.
513
+ *
514
+ * `throwOnError` and `strict` are disabled so a malformed expression renders best-effort
515
+ * output instead of throwing.
516
+ */
517
+ declare function toLaTeX(latex: string, opts?: {
518
+ displayMode?: boolean;
519
+ }): string;
520
+
521
+ declare const codeBlockRootBase = "not-prose my-4 overflow-hidden rounded-lg border";
522
+ declare const codeBlockHeaderBase = "flex h-10 items-center justify-between gap-2 border-b bg-muted/50 px-4";
523
+ declare const codeBlockHeaderInfoBase = "flex min-w-0 items-center gap-2 text-muted-foreground";
524
+ declare const codeBlockTitleBase = "min-w-0 truncate font-mono text-xs";
525
+ declare const codeBlockBodyBase = "hx-cb relative overflow-x-auto bg-background";
526
+ declare const codeBlockBodyScrollableBase = "overflow-y-auto";
527
+ declare const codeBlockContentBase = "text-sm [&>pre]:p-4 [&_.line]:leading-[1.7]";
528
+ declare const codeBlockLineNumbersBase = "cbln";
529
+ declare const codeBlockHighlightBase = "cbhl";
530
+ declare const codeBlockLoadingBase = "flex h-16 items-center justify-center";
531
+ declare const codeBlockSpinnerBase = "h-4 w-4 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent";
532
+ /** Floating copy button anchored to the code body's top-right corner (multi-language block). */
533
+ declare const codeBlockCopyFloatBase = "absolute right-2 top-2";
534
+ interface FileEntry {
535
+ filename: string;
536
+ code: string;
537
+ language?: string;
538
+ /** Pre-rendered shiki HTML for the static/server path. */
539
+ html?: string;
540
+ }
541
+ interface LanguageTab {
542
+ label: string;
543
+ filename: string;
544
+ code: string;
545
+ language?: string;
546
+ /** Pre-rendered shiki HTML for the static/server path. */
547
+ html?: string;
548
+ }
549
+ interface CodeBlockProps {
550
+ code: string;
551
+ /** Shiki language id (default `tsx`). */
552
+ language?: string;
553
+ filename?: string;
554
+ /** Pre-rendered shiki HTML for the static/server path. */
555
+ html?: string;
556
+ showLineNumbers?: boolean;
557
+ scrollable?: boolean;
558
+ maxHeight?: number;
559
+ /** 1-based line numbers to highlight. */
560
+ highlightLines?: number[];
561
+ className?: string;
562
+ }
563
+ declare function injectCodeBlockStyles(): void;
564
+ /**
565
+ * Dynamically import shiki and highlight `code` to an HTML string. The import stays
566
+ * client-only and lazy, so shiki never enters the SSR/initial bundle. Unknown languages
567
+ * or any highlight failure fall back to escaped plaintext — never throws.
568
+ */
569
+ declare function renderCodeToHtml(code: string, language: string, highlightLines?: number[]): Promise<string>;
570
+
571
+ declare const manimRootBase = "not-prose my-4";
572
+ declare const manimContainerBase = "relative w-full overflow-hidden rounded-lg border border-border [&_canvas]:!h-auto [&_canvas]:!max-w-full";
573
+ declare const manimPlaceholderBase = "flex w-full items-center justify-center bg-muted/40";
574
+ declare const manimPlaceholderLabelBase = "text-sm text-muted-foreground";
575
+ declare const manimErrorBase = "flex items-center justify-center border-destructive/50 bg-destructive/5 p-6 text-sm text-destructive";
576
+ declare const manimCaptionBase = "mt-2 text-center text-sm text-muted-foreground";
577
+ /** The recording proxy `manim-web` hands to a scene builder — records `play`/`wait` calls. */
578
+ interface ManimRecordingScene {
579
+ play(...animations: unknown[]): Promise<void>;
580
+ wait(duration?: number): Promise<void>;
581
+ }
582
+ type ManimModule = typeof ManimWeb;
583
+ interface ManimProps {
584
+ /** Scene builder — receives the `manim-web` module (imported internally by the component) and
585
+ * the recording proxy. Define the animation with `manim`'s primitives (`Circle`, `Create`, …)
586
+ * without importing `manim-web` yourself. */
587
+ build: (manim: ManimModule, scene: ManimRecordingScene) => Promise<void> | void;
588
+ /** Aspect-ratio width component (default 800). */
589
+ width?: number;
590
+ /** Aspect-ratio height component (default 450). */
591
+ height?: number;
592
+ caption?: string;
593
+ className?: string;
594
+ }
595
+
596
+ declare const youtubeRootBase = "not-prose my-4";
597
+ declare const youtubeTitleBase = "mb-2 text-lg font-semibold text-foreground";
598
+ declare const youtubeFacadeBase = "group relative aspect-video w-full cursor-pointer overflow-hidden rounded-md border border-border bg-muted/40";
599
+ declare const youtubePlayButtonBase = "absolute inset-0 flex items-center justify-center";
600
+ declare const youtubePlayButtonInnerBase = "flex items-center justify-center rounded-xl bg-red-600 px-4 py-2 text-white shadow-lg transition-transform group-hover:scale-105";
601
+ declare const youtubeDescriptionBase = "mt-2 text-sm text-muted-foreground";
602
+ declare const youtubeChaptersBase = "group mt-3 rounded-lg border border-border bg-muted/40";
603
+ declare const youtubeChaptersSummaryBase = "flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium [&::-webkit-details-marker]:hidden";
604
+ declare const youtubeChaptersChevronBase = "size-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-90";
605
+ declare const youtubeChaptersListBase = "border-t border-border px-2 py-2";
606
+ declare const youtubeChapterButtonBase = "inline-flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
607
+ declare const youtubeChapterTimeBase = "font-mono text-xs text-primary";
608
+ declare const youtubeChapterLabelBase = "text-foreground";
609
+ interface YouTubeChapter {
610
+ /** Timestamp in seconds. */
611
+ t: number;
612
+ label: string;
613
+ }
614
+ interface YouTubeProps {
615
+ /** YouTube video URL (`youtube.com/watch?v=…`, `youtu.be/…`, or a short URL). */
616
+ url: string;
617
+ title?: string;
618
+ description?: string;
619
+ /** Custom poster URL (defaults to YouTube's hqdefault thumbnail). */
620
+ poster?: string;
621
+ className?: string;
622
+ }
623
+ /** Extract a bare video ID from either a full YouTube URL or a plain ID. */
624
+ declare function extractYouTubeId(raw: string): string;
625
+ /** Format seconds to `mm:ss` (or `h:mm:ss`). */
626
+ declare function formatTime(seconds: number): string;
627
+ /** Parse a chapter list from a YouTube description: one `mm:ss Description` (or `h:mm:ss`)
628
+ * per line. Returns `[]` when none parse. */
629
+ declare function parseYouTubeChapters(description: string): YouTubeChapter[];
630
+ /** Fetch a video's title/description from a CORS-friendly oEmbed proxy (noembed.com).
631
+ * Used by `YoutubeTimestamps` to auto-infer chapters from the video's web metadata. */
632
+ declare function fetchYouTubeMetadata(url: string): Promise<{
633
+ title?: string;
634
+ description?: string;
635
+ }>;
636
+
637
+ declare const chartRootBase = "not-prose my-4";
638
+ declare const chartPlaceholderBase = "flex items-center justify-center rounded-md border border-border bg-muted/40";
639
+ declare const chartPlaceholderLabelBase = "text-sm text-muted-foreground";
640
+ interface ChartSeries {
641
+ key: string;
642
+ label?: string;
643
+ color?: string;
644
+ }
645
+ interface ChartProps {
646
+ type: 'line' | 'bar' | 'area' | 'pie';
647
+ data: Record<string, string | number>[];
648
+ series: ChartSeries[];
649
+ xKey?: string;
650
+ nameKey?: string;
651
+ height?: number;
652
+ showLegend?: boolean;
653
+ showGrid?: boolean;
654
+ showAxis?: boolean;
655
+ className?: string;
656
+ }
657
+ /** Return `var(--chart-N)` cycling through the five chart tokens. */
658
+ declare function defaultChartColor(index: number): string;
659
+ /**
660
+ * Build a framework-agnostic TanStack Charts definition from the helix `ChartProps`. The
661
+ * React and Svelte adapters both render this same definition, so the chart is identical
662
+ * across frameworks and can be server-rendered with `renderChartSvgString`.
663
+ *
664
+ * Channels (`x`, `y`, `z`, `color`) are runtime string keys, so they are cast through
665
+ * `as never` at the boundary — TanStack's literal-key typing cannot express dynamic keys.
666
+ */
667
+ declare function buildChartDefinition(props: ChartProps): DomChartDefinition;
668
+ /** Render a chart to an SVG string on the server (SSR / prerendered path). */
669
+ declare function renderChartSvgString(props: ChartProps, opts?: {
670
+ width?: number;
671
+ height?: number;
672
+ ariaLabel?: string;
673
+ }): string;
674
+
675
+ interface SingleChoiceQuestionData {
676
+ id: string;
677
+ type: 'single';
678
+ prompt: string;
679
+ choices: string[];
680
+ correct: number;
681
+ explanation?: string;
682
+ }
683
+ interface MultipleChoiceQuestionData {
684
+ id: string;
685
+ type: 'multiple';
686
+ prompt: string;
687
+ choices: string[];
688
+ correct: number[];
689
+ explanation?: string;
690
+ }
691
+ interface NumericQuestionData {
692
+ id: string;
693
+ type: 'numeric';
694
+ prompt: string;
695
+ answer: number;
696
+ tolerance?: number;
697
+ unit?: string;
698
+ explanation?: string;
699
+ }
700
+ type Question = SingleChoiceQuestionData | MultipleChoiceQuestionData | NumericQuestionData;
701
+ declare const questionCardBase = "not-prose my-4 rounded-lg border border-border bg-card p-4";
702
+ declare const questionPromptBase = "mb-3 text-sm font-medium text-foreground";
703
+ declare const questionGroupBase = "grid gap-2";
704
+ declare const questionOptionBase = "rounded-md px-3 py-2 transition-colors hover:bg-muted/60";
705
+ declare const questionOptionCorrectBase = "bg-success/10";
706
+ declare const questionOptionIncorrectBase = "bg-destructive/10";
707
+ declare const questionCheckButtonBase = "mt-3 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";
708
+ declare const questionInputBase = "h-9 w-32 rounded-md border border-input bg-background px-3 text-sm text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
709
+ declare const questionUnitBase = "text-sm text-muted-foreground";
710
+ declare const feedbackCorrectBase = "text-success";
711
+ declare const feedbackIncorrectBase = "text-destructive";
712
+ declare const feedbackExplanationBase = "mt-1.5 text-sm text-muted-foreground";
713
+ declare const quizRootBase = "not-prose my-6 rounded-lg border border-border bg-card/50 p-4";
714
+ declare const quizHeaderBase = "mb-4 flex items-center justify-between gap-3";
715
+ declare const quizTitleBase = "text-base font-semibold text-foreground";
716
+ declare const quizScoreBase = "inline-flex items-center rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground";
717
+ declare const quizResultBase = "mt-4 rounded-lg border border-border bg-muted/40 p-4";
718
+ declare const quizResultTitleBase = "text-lg font-semibold text-foreground";
719
+ declare const quizResultTextBase = "mt-1 text-sm text-muted-foreground";
720
+ declare const quizSubmitButtonBase = "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";
721
+ declare const quizResetButtonBase = "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
722
+
723
+ export { type BadgeProps, type BadgeVariants, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type ChartProps, type ChartSeries, type CheckboxProps, type CheckboxVariants, type CodeBlockProps, type ComboboxItemVariants, type ComboboxProps, type FigureProps, type FileEntry, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type LaTeXProps, type LanguageTab, type ManimModule, type ManimProps, type ManimRecordingScene, type MermaidProps, type MultipleChoiceQuestionData, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NoticeProps, type NoticeVariants, type NumberInputProps, type NumericQuestionData, type PageGutterContentVariants, type PageGutterVariants, type PageVariants, type PrevNextProps, type Question, type RevealProps, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SingleChoiceQuestionData, type SwitchProps, type SwitchVariants, THEMES, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeMeta, type ToggleButtonProps, type ToggleButtonVariants, type YouTubeChapter, type YouTubeProps, badgeVariants, buildChartDefinition, buttonVariants, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, chartPlaceholderBase, chartPlaceholderLabelBase, chartRootBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, clipboardTriggerBase, cn, codeBlockBodyBase, codeBlockBodyScrollableBase, codeBlockContentBase, codeBlockCopyFloatBase, codeBlockHeaderBase, codeBlockHeaderInfoBase, codeBlockHighlightBase, codeBlockLineNumbersBase, codeBlockLoadingBase, codeBlockRootBase, codeBlockSpinnerBase, codeBlockTitleBase, colBase, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, defaultChartColor, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogTitleBase, extractYouTubeId, feedbackCorrectBase, feedbackExplanationBase, feedbackIncorrectBase, fetchYouTubeMetadata, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, figureCaptionBase, figureImageBase, figureRootBase, formatTime, hstackBase, injectCodeBlockStyles, inputVariants, itemVariants, latexDisplayBase, latexErrorBase, latexInlineBase, latexRootBase, manimCaptionBase, manimContainerBase, manimErrorBase, manimPlaceholderBase, manimPlaceholderLabelBase, manimRootBase, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, noticeDescriptionBase, noticeTitleBase, noticeVariants, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, parseYouTubeChapters, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, prevNextDirectionBase, prevNextLinkBase, prevNextLinkNextBase, prevNextRootBase, prevNextSpacerBase, prevNextTitleBase, questionCardBase, questionCheckButtonBase, questionGroupBase, questionInputBase, questionOptionBase, questionOptionCorrectBase, questionOptionIncorrectBase, questionPromptBase, questionUnitBase, quizHeaderBase, quizResetButtonBase, quizResultBase, quizResultTextBase, quizResultTitleBase, quizRootBase, quizScoreBase, quizSubmitButtonBase, quizTitleBase, radioGroupItemControlBase, radioGroupItemTextBase, radioGroupRootBase, renderChartSvgString, renderCodeToHtml, renderMermaidSource, resolveMermaidThemeVariables, revealChevronBase, revealContentBase, revealRootBase, revealTriggerBase, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, sidebarMenuButtonVariants, sidebarStyles, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, toLaTeX, toggleButtonVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, vstackBase, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase, youtubeChapterButtonBase, youtubeChapterLabelBase, youtubeChapterTimeBase, youtubeChaptersBase, youtubeChaptersChevronBase, youtubeChaptersListBase, youtubeChaptersSummaryBase, youtubeDescriptionBase, youtubeFacadeBase, youtubePlayButtonBase, youtubePlayButtonInnerBase, youtubeRootBase, youtubeTitleBase };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import { ClassValue } from 'clsx';
4
+ import * as ManimWeb from 'manim-web';
5
+ import { DomChartDefinition } from '@tanstack/charts';
4
6
 
5
7
  declare const buttonVariants: (props?: ({
6
8
  variant?: "solid" | "outline" | "text" | null | undefined;
@@ -435,4 +437,287 @@ declare function mermaidSvgAspectRatio(svg: string): string | undefined;
435
437
  */
436
438
  declare function renderMermaidSource(code: string): Promise<string>;
437
439
 
438
- export { type BadgeProps, type BadgeVariants, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type CheckboxProps, type CheckboxVariants, type ComboboxItemVariants, type ComboboxProps, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type MermaidProps, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NumberInputProps, type PageGutterContentVariants, type PageGutterVariants, type PageVariants, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SwitchProps, type SwitchVariants, THEMES, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeMeta, type ToggleButtonProps, type ToggleButtonVariants, badgeVariants, buttonVariants, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, cn, colBase, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogTitleBase, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, hstackBase, inputVariants, itemVariants, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, renderMermaidSource, resolveMermaidThemeVariables, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, sidebarMenuButtonVariants, sidebarStyles, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, toggleButtonVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, vstackBase, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase };
440
+ /** Ghost icon-button styling for a copy trigger, reused by the code-block family. */
441
+ declare const clipboardTriggerBase = "inline-flex h-7 w-7 shrink-0 items-center justify-center gap-1.5 rounded-md text-xs text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-3.5 [&_svg]:shrink-0";
442
+
443
+ declare const radioGroupRootBase = "flex flex-col gap-2";
444
+ declare const radioGroupItemControlBase = "relative inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input bg-transparent shadow-xs transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:ring-offset-1 focus-visible:ring-offset-background data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24 data-[state=checked]:border-primary data-[state=checked]:text-primary disabled:pointer-events-none disabled:opacity-50";
445
+ declare const radioGroupItemTextBase = "select-none text-sm font-medium leading-none";
446
+
447
+ declare const noticeVariants: (props?: ({
448
+ variant?: "success" | "info" | "none" | "warning" | "error" | null | undefined;
449
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
450
+ type NoticeVariants = VariantProps<typeof noticeVariants>;
451
+ declare const noticeTitleBase = "col-start-2 min-h-4 font-semibold tracking-tight";
452
+ declare const noticeDescriptionBase = "col-start-2 text-sm text-foreground [&_p]:leading-relaxed";
453
+ interface NoticeProps {
454
+ variant?: NoticeVariants['variant'];
455
+ title?: string;
456
+ className?: string;
457
+ }
458
+
459
+ declare const figureRootBase = "not-prose my-4 flex flex-col items-center";
460
+ declare const figureImageBase = "rounded-lg border border-border";
461
+ declare const figureCaptionBase = "mt-2 text-center text-sm text-muted-foreground";
462
+ interface FigureProps {
463
+ src?: string;
464
+ alt?: string;
465
+ caption?: string;
466
+ className?: string;
467
+ }
468
+
469
+ declare const revealRootBase = "not-prose my-4 overflow-hidden rounded-lg border border-border bg-muted/40";
470
+ declare const revealTriggerBase = "flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-sm font-semibold";
471
+ declare const revealChevronBase = "size-4 shrink-0 text-muted-foreground transition-transform duration-200 data-[state=open]:rotate-90";
472
+ declare const revealContentBase = "border-t border-border px-3 py-2.5 text-sm text-foreground";
473
+ interface RevealProps {
474
+ question: string;
475
+ className?: string;
476
+ }
477
+
478
+ declare const prevNextRootBase = "not-prose mt-8 flex flex-col gap-3 border-t border-border pt-6 sm:flex-row sm:justify-between";
479
+ declare const prevNextLinkBase = "group flex min-w-0 flex-1 flex-col rounded-lg border border-border px-4 py-3 no-underline transition-colors hover:border-primary";
480
+ declare const prevNextLinkNextBase = "items-end text-right";
481
+ declare const prevNextDirectionBase = "text-xs font-medium text-muted-foreground";
482
+ declare const prevNextTitleBase = "truncate text-sm font-medium text-foreground transition-colors group-hover:text-primary";
483
+ declare const prevNextSpacerBase = "flex-1";
484
+ interface PrevNextProps {
485
+ prev?: {
486
+ title: string;
487
+ href: string;
488
+ };
489
+ next?: {
490
+ title: string;
491
+ href: string;
492
+ };
493
+ className?: string;
494
+ }
495
+
496
+ declare const latexRootBase = "not-prose";
497
+ declare const latexDisplayBase = "my-4 block w-full overflow-x-auto py-1";
498
+ declare const latexInlineBase = "inline-block align-middle";
499
+ declare const latexErrorBase = "font-mono text-sm text-destructive";
500
+ interface LaTeXProps {
501
+ /** LaTeX source. */
502
+ latex: string;
503
+ /** Pre-rendered KaTeX HTML for the static/server path. When provided the component renders it
504
+ * immediately and never calls `katex` — a rehype-katex-style plugin can pass its output here. */
505
+ html?: string;
506
+ /** Extra classes for the root container. */
507
+ className?: string;
508
+ }
509
+ /**
510
+ * Render LaTeX to KaTeX HTML synchronously. `katex` is a hard dependency, so this works at
511
+ * build/SSR time (a rehype plugin or `renderToStaticMarkup` path) and on the client alike —
512
+ * no lazy import, no placeholder, no double render.
513
+ *
514
+ * `throwOnError` and `strict` are disabled so a malformed expression renders best-effort
515
+ * output instead of throwing.
516
+ */
517
+ declare function toLaTeX(latex: string, opts?: {
518
+ displayMode?: boolean;
519
+ }): string;
520
+
521
+ declare const codeBlockRootBase = "not-prose my-4 overflow-hidden rounded-lg border";
522
+ declare const codeBlockHeaderBase = "flex h-10 items-center justify-between gap-2 border-b bg-muted/50 px-4";
523
+ declare const codeBlockHeaderInfoBase = "flex min-w-0 items-center gap-2 text-muted-foreground";
524
+ declare const codeBlockTitleBase = "min-w-0 truncate font-mono text-xs";
525
+ declare const codeBlockBodyBase = "hx-cb relative overflow-x-auto bg-background";
526
+ declare const codeBlockBodyScrollableBase = "overflow-y-auto";
527
+ declare const codeBlockContentBase = "text-sm [&>pre]:p-4 [&_.line]:leading-[1.7]";
528
+ declare const codeBlockLineNumbersBase = "cbln";
529
+ declare const codeBlockHighlightBase = "cbhl";
530
+ declare const codeBlockLoadingBase = "flex h-16 items-center justify-center";
531
+ declare const codeBlockSpinnerBase = "h-4 w-4 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent";
532
+ /** Floating copy button anchored to the code body's top-right corner (multi-language block). */
533
+ declare const codeBlockCopyFloatBase = "absolute right-2 top-2";
534
+ interface FileEntry {
535
+ filename: string;
536
+ code: string;
537
+ language?: string;
538
+ /** Pre-rendered shiki HTML for the static/server path. */
539
+ html?: string;
540
+ }
541
+ interface LanguageTab {
542
+ label: string;
543
+ filename: string;
544
+ code: string;
545
+ language?: string;
546
+ /** Pre-rendered shiki HTML for the static/server path. */
547
+ html?: string;
548
+ }
549
+ interface CodeBlockProps {
550
+ code: string;
551
+ /** Shiki language id (default `tsx`). */
552
+ language?: string;
553
+ filename?: string;
554
+ /** Pre-rendered shiki HTML for the static/server path. */
555
+ html?: string;
556
+ showLineNumbers?: boolean;
557
+ scrollable?: boolean;
558
+ maxHeight?: number;
559
+ /** 1-based line numbers to highlight. */
560
+ highlightLines?: number[];
561
+ className?: string;
562
+ }
563
+ declare function injectCodeBlockStyles(): void;
564
+ /**
565
+ * Dynamically import shiki and highlight `code` to an HTML string. The import stays
566
+ * client-only and lazy, so shiki never enters the SSR/initial bundle. Unknown languages
567
+ * or any highlight failure fall back to escaped plaintext — never throws.
568
+ */
569
+ declare function renderCodeToHtml(code: string, language: string, highlightLines?: number[]): Promise<string>;
570
+
571
+ declare const manimRootBase = "not-prose my-4";
572
+ declare const manimContainerBase = "relative w-full overflow-hidden rounded-lg border border-border [&_canvas]:!h-auto [&_canvas]:!max-w-full";
573
+ declare const manimPlaceholderBase = "flex w-full items-center justify-center bg-muted/40";
574
+ declare const manimPlaceholderLabelBase = "text-sm text-muted-foreground";
575
+ declare const manimErrorBase = "flex items-center justify-center border-destructive/50 bg-destructive/5 p-6 text-sm text-destructive";
576
+ declare const manimCaptionBase = "mt-2 text-center text-sm text-muted-foreground";
577
+ /** The recording proxy `manim-web` hands to a scene builder — records `play`/`wait` calls. */
578
+ interface ManimRecordingScene {
579
+ play(...animations: unknown[]): Promise<void>;
580
+ wait(duration?: number): Promise<void>;
581
+ }
582
+ type ManimModule = typeof ManimWeb;
583
+ interface ManimProps {
584
+ /** Scene builder — receives the `manim-web` module (imported internally by the component) and
585
+ * the recording proxy. Define the animation with `manim`'s primitives (`Circle`, `Create`, …)
586
+ * without importing `manim-web` yourself. */
587
+ build: (manim: ManimModule, scene: ManimRecordingScene) => Promise<void> | void;
588
+ /** Aspect-ratio width component (default 800). */
589
+ width?: number;
590
+ /** Aspect-ratio height component (default 450). */
591
+ height?: number;
592
+ caption?: string;
593
+ className?: string;
594
+ }
595
+
596
+ declare const youtubeRootBase = "not-prose my-4";
597
+ declare const youtubeTitleBase = "mb-2 text-lg font-semibold text-foreground";
598
+ declare const youtubeFacadeBase = "group relative aspect-video w-full cursor-pointer overflow-hidden rounded-md border border-border bg-muted/40";
599
+ declare const youtubePlayButtonBase = "absolute inset-0 flex items-center justify-center";
600
+ declare const youtubePlayButtonInnerBase = "flex items-center justify-center rounded-xl bg-red-600 px-4 py-2 text-white shadow-lg transition-transform group-hover:scale-105";
601
+ declare const youtubeDescriptionBase = "mt-2 text-sm text-muted-foreground";
602
+ declare const youtubeChaptersBase = "group mt-3 rounded-lg border border-border bg-muted/40";
603
+ declare const youtubeChaptersSummaryBase = "flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium [&::-webkit-details-marker]:hidden";
604
+ declare const youtubeChaptersChevronBase = "size-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-90";
605
+ declare const youtubeChaptersListBase = "border-t border-border px-2 py-2";
606
+ declare const youtubeChapterButtonBase = "inline-flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
607
+ declare const youtubeChapterTimeBase = "font-mono text-xs text-primary";
608
+ declare const youtubeChapterLabelBase = "text-foreground";
609
+ interface YouTubeChapter {
610
+ /** Timestamp in seconds. */
611
+ t: number;
612
+ label: string;
613
+ }
614
+ interface YouTubeProps {
615
+ /** YouTube video URL (`youtube.com/watch?v=…`, `youtu.be/…`, or a short URL). */
616
+ url: string;
617
+ title?: string;
618
+ description?: string;
619
+ /** Custom poster URL (defaults to YouTube's hqdefault thumbnail). */
620
+ poster?: string;
621
+ className?: string;
622
+ }
623
+ /** Extract a bare video ID from either a full YouTube URL or a plain ID. */
624
+ declare function extractYouTubeId(raw: string): string;
625
+ /** Format seconds to `mm:ss` (or `h:mm:ss`). */
626
+ declare function formatTime(seconds: number): string;
627
+ /** Parse a chapter list from a YouTube description: one `mm:ss Description` (or `h:mm:ss`)
628
+ * per line. Returns `[]` when none parse. */
629
+ declare function parseYouTubeChapters(description: string): YouTubeChapter[];
630
+ /** Fetch a video's title/description from a CORS-friendly oEmbed proxy (noembed.com).
631
+ * Used by `YoutubeTimestamps` to auto-infer chapters from the video's web metadata. */
632
+ declare function fetchYouTubeMetadata(url: string): Promise<{
633
+ title?: string;
634
+ description?: string;
635
+ }>;
636
+
637
+ declare const chartRootBase = "not-prose my-4";
638
+ declare const chartPlaceholderBase = "flex items-center justify-center rounded-md border border-border bg-muted/40";
639
+ declare const chartPlaceholderLabelBase = "text-sm text-muted-foreground";
640
+ interface ChartSeries {
641
+ key: string;
642
+ label?: string;
643
+ color?: string;
644
+ }
645
+ interface ChartProps {
646
+ type: 'line' | 'bar' | 'area' | 'pie';
647
+ data: Record<string, string | number>[];
648
+ series: ChartSeries[];
649
+ xKey?: string;
650
+ nameKey?: string;
651
+ height?: number;
652
+ showLegend?: boolean;
653
+ showGrid?: boolean;
654
+ showAxis?: boolean;
655
+ className?: string;
656
+ }
657
+ /** Return `var(--chart-N)` cycling through the five chart tokens. */
658
+ declare function defaultChartColor(index: number): string;
659
+ /**
660
+ * Build a framework-agnostic TanStack Charts definition from the helix `ChartProps`. The
661
+ * React and Svelte adapters both render this same definition, so the chart is identical
662
+ * across frameworks and can be server-rendered with `renderChartSvgString`.
663
+ *
664
+ * Channels (`x`, `y`, `z`, `color`) are runtime string keys, so they are cast through
665
+ * `as never` at the boundary — TanStack's literal-key typing cannot express dynamic keys.
666
+ */
667
+ declare function buildChartDefinition(props: ChartProps): DomChartDefinition;
668
+ /** Render a chart to an SVG string on the server (SSR / prerendered path). */
669
+ declare function renderChartSvgString(props: ChartProps, opts?: {
670
+ width?: number;
671
+ height?: number;
672
+ ariaLabel?: string;
673
+ }): string;
674
+
675
+ interface SingleChoiceQuestionData {
676
+ id: string;
677
+ type: 'single';
678
+ prompt: string;
679
+ choices: string[];
680
+ correct: number;
681
+ explanation?: string;
682
+ }
683
+ interface MultipleChoiceQuestionData {
684
+ id: string;
685
+ type: 'multiple';
686
+ prompt: string;
687
+ choices: string[];
688
+ correct: number[];
689
+ explanation?: string;
690
+ }
691
+ interface NumericQuestionData {
692
+ id: string;
693
+ type: 'numeric';
694
+ prompt: string;
695
+ answer: number;
696
+ tolerance?: number;
697
+ unit?: string;
698
+ explanation?: string;
699
+ }
700
+ type Question = SingleChoiceQuestionData | MultipleChoiceQuestionData | NumericQuestionData;
701
+ declare const questionCardBase = "not-prose my-4 rounded-lg border border-border bg-card p-4";
702
+ declare const questionPromptBase = "mb-3 text-sm font-medium text-foreground";
703
+ declare const questionGroupBase = "grid gap-2";
704
+ declare const questionOptionBase = "rounded-md px-3 py-2 transition-colors hover:bg-muted/60";
705
+ declare const questionOptionCorrectBase = "bg-success/10";
706
+ declare const questionOptionIncorrectBase = "bg-destructive/10";
707
+ declare const questionCheckButtonBase = "mt-3 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";
708
+ declare const questionInputBase = "h-9 w-32 rounded-md border border-input bg-background px-3 text-sm text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
709
+ declare const questionUnitBase = "text-sm text-muted-foreground";
710
+ declare const feedbackCorrectBase = "text-success";
711
+ declare const feedbackIncorrectBase = "text-destructive";
712
+ declare const feedbackExplanationBase = "mt-1.5 text-sm text-muted-foreground";
713
+ declare const quizRootBase = "not-prose my-6 rounded-lg border border-border bg-card/50 p-4";
714
+ declare const quizHeaderBase = "mb-4 flex items-center justify-between gap-3";
715
+ declare const quizTitleBase = "text-base font-semibold text-foreground";
716
+ declare const quizScoreBase = "inline-flex items-center rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground";
717
+ declare const quizResultBase = "mt-4 rounded-lg border border-border bg-muted/40 p-4";
718
+ declare const quizResultTitleBase = "text-lg font-semibold text-foreground";
719
+ declare const quizResultTextBase = "mt-1 text-sm text-muted-foreground";
720
+ declare const quizSubmitButtonBase = "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";
721
+ declare const quizResetButtonBase = "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
722
+
723
+ export { type BadgeProps, type BadgeVariants, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type ChartProps, type ChartSeries, type CheckboxProps, type CheckboxVariants, type CodeBlockProps, type ComboboxItemVariants, type ComboboxProps, type FigureProps, type FileEntry, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type LaTeXProps, type LanguageTab, type ManimModule, type ManimProps, type ManimRecordingScene, type MermaidProps, type MultipleChoiceQuestionData, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NoticeProps, type NoticeVariants, type NumberInputProps, type NumericQuestionData, type PageGutterContentVariants, type PageGutterVariants, type PageVariants, type PrevNextProps, type Question, type RevealProps, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SingleChoiceQuestionData, type SwitchProps, type SwitchVariants, THEMES, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeMeta, type ToggleButtonProps, type ToggleButtonVariants, type YouTubeChapter, type YouTubeProps, badgeVariants, buildChartDefinition, buttonVariants, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, chartPlaceholderBase, chartPlaceholderLabelBase, chartRootBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, clipboardTriggerBase, cn, codeBlockBodyBase, codeBlockBodyScrollableBase, codeBlockContentBase, codeBlockCopyFloatBase, codeBlockHeaderBase, codeBlockHeaderInfoBase, codeBlockHighlightBase, codeBlockLineNumbersBase, codeBlockLoadingBase, codeBlockRootBase, codeBlockSpinnerBase, codeBlockTitleBase, colBase, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, defaultChartColor, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogTitleBase, extractYouTubeId, feedbackCorrectBase, feedbackExplanationBase, feedbackIncorrectBase, fetchYouTubeMetadata, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, figureCaptionBase, figureImageBase, figureRootBase, formatTime, hstackBase, injectCodeBlockStyles, inputVariants, itemVariants, latexDisplayBase, latexErrorBase, latexInlineBase, latexRootBase, manimCaptionBase, manimContainerBase, manimErrorBase, manimPlaceholderBase, manimPlaceholderLabelBase, manimRootBase, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, noticeDescriptionBase, noticeTitleBase, noticeVariants, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, parseYouTubeChapters, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, prevNextDirectionBase, prevNextLinkBase, prevNextLinkNextBase, prevNextRootBase, prevNextSpacerBase, prevNextTitleBase, questionCardBase, questionCheckButtonBase, questionGroupBase, questionInputBase, questionOptionBase, questionOptionCorrectBase, questionOptionIncorrectBase, questionPromptBase, questionUnitBase, quizHeaderBase, quizResetButtonBase, quizResultBase, quizResultTextBase, quizResultTitleBase, quizRootBase, quizScoreBase, quizSubmitButtonBase, quizTitleBase, radioGroupItemControlBase, radioGroupItemTextBase, radioGroupRootBase, renderChartSvgString, renderCodeToHtml, renderMermaidSource, resolveMermaidThemeVariables, revealChevronBase, revealContentBase, revealRootBase, revealTriggerBase, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, sidebarMenuButtonVariants, sidebarStyles, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, toLaTeX, toggleButtonVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, vstackBase, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase, youtubeChapterButtonBase, youtubeChapterLabelBase, youtubeChapterTimeBase, youtubeChaptersBase, youtubeChaptersChevronBase, youtubeChaptersListBase, youtubeChaptersSummaryBase, youtubeDescriptionBase, youtubeFacadeBase, youtubePlayButtonBase, youtubePlayButtonInnerBase, youtubeRootBase, youtubeTitleBase };