@nicorp/nui 0.10.0 → 0.11.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.ts CHANGED
@@ -99,6 +99,82 @@ declare interface AppShellProps extends React_2.HTMLAttributes<HTMLDivElement> {
99
99
 
100
100
  export declare const AspectRatio: ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & RefAttributes<HTMLDivElement>>;
101
101
 
102
+ export declare function AudioPlayer({ src, title, artist, albumArt, showWaveform, showVolume, defaultVolume, autoPlay, loop, preload, size, onPlay, onPause, onEnded, onTimeUpdate, className, }: AudioPlayerProps): JSX_2.Element;
103
+
104
+ export declare interface AudioPlayerProps extends VariantProps<typeof audioPlayerVariants> {
105
+ src: string;
106
+ title?: string;
107
+ artist?: string;
108
+ albumArt?: string;
109
+ showWaveform?: boolean;
110
+ showVolume?: boolean;
111
+ defaultVolume?: number;
112
+ autoPlay?: boolean;
113
+ loop?: boolean;
114
+ preload?: "none" | "metadata" | "auto";
115
+ onPlay?: () => void;
116
+ onPause?: () => void;
117
+ onEnded?: () => void;
118
+ onTimeUpdate?: (currentTime: number) => void;
119
+ className?: string;
120
+ }
121
+
122
+ export declare const audioPlayerVariants: (props?: ({
123
+ size?: "default" | "sm" | "lg" | null | undefined;
124
+ } & ClassProp) | undefined) => string;
125
+
126
+ export declare function AudioPlaylist({ tracks, showWaveform, defaultRepeatMode, defaultShuffle, autoPlay, onTrackChange, onPlayStateChange, className, }: AudioPlaylistProps): JSX_2.Element | null;
127
+
128
+ export declare interface AudioPlaylistProps {
129
+ tracks: AudioTrack[];
130
+ showWaveform?: boolean;
131
+ defaultRepeatMode?: RepeatMode;
132
+ defaultShuffle?: boolean;
133
+ autoPlay?: boolean;
134
+ onTrackChange?: (track: AudioTrack, index: number) => void;
135
+ onPlayStateChange?: (isPlaying: boolean) => void;
136
+ className?: string;
137
+ }
138
+
139
+ export declare function AudioRecorder({ mimeType, maxDuration, showWaveform, onRecordingComplete, onRecordingStart, onError, className, }: AudioRecorderProps): JSX_2.Element;
140
+
141
+ export declare interface AudioRecorderProps {
142
+ mimeType?: string;
143
+ maxDuration?: number;
144
+ showWaveform?: boolean;
145
+ onRecordingComplete?: (blob: Blob) => void;
146
+ onRecordingStart?: () => void;
147
+ onError?: (error: Error) => void;
148
+ className?: string;
149
+ }
150
+
151
+ export declare interface AudioTrack {
152
+ id: string;
153
+ src: string;
154
+ title: string;
155
+ artist?: string;
156
+ albumArt?: string;
157
+ duration?: number;
158
+ }
159
+
160
+ export declare const AudioWaveform: React_2.ForwardRefExoticComponent<AudioWaveformProps & React_2.RefAttributes<HTMLDivElement>>;
161
+
162
+ export declare interface AudioWaveformProps extends React_2.HTMLAttributes<HTMLDivElement> {
163
+ src?: string;
164
+ data?: number[];
165
+ stream?: MediaStream;
166
+ color?: string;
167
+ progressColor?: string;
168
+ progress?: number;
169
+ height?: number;
170
+ barCount?: number;
171
+ barWidth?: number;
172
+ barGap?: number;
173
+ barRadius?: number;
174
+ mirrored?: boolean;
175
+ onSeek?: (position: number) => void;
176
+ }
177
+
102
178
  export declare const Avatar: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React_2.RefAttributes<HTMLSpanElement>, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
103
179
 
104
180
  export declare const AvatarFallback: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React_2.RefAttributes<HTMLSpanElement>, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
@@ -489,6 +565,8 @@ export declare interface ChatQuestionProps extends Omit<React_2.HTMLAttributes<H
489
565
  onFreeTextSubmit?: (text: string) => void;
490
566
  /** Grid columns for options @default 1 */
491
567
  columns?: 1 | 2;
568
+ /** Free text value that was submitted (for restore) */
569
+ freeTextValue?: string | null;
492
570
  }
493
571
 
494
572
  export declare const ChatResultCard: React_2.ForwardRefExoticComponent<ChatResultCardProps & React_2.RefAttributes<HTMLDivElement>>;
@@ -762,6 +840,13 @@ declare interface CopyInputProps extends React_2.InputHTMLAttributes<HTMLInputEl
762
840
  value: string;
763
841
  }
764
842
 
843
+ export declare interface CropArea {
844
+ x: number;
845
+ y: number;
846
+ width: number;
847
+ height: number;
848
+ }
849
+
765
850
  export declare function DataTable<TData, TValue>({ columns, data, searchKey, searchPlaceholder, pageSize, }: DataTableProps<TData, TValue>): JSX_2.Element;
766
851
 
767
852
  export declare function DataTableColumnHeader({ column, title, className, }: {
@@ -915,6 +1000,8 @@ export declare interface FollowUpOption {
915
1000
  description?: string;
916
1001
  }
917
1002
 
1003
+ export declare function formatTime(seconds: number): string;
1004
+
918
1005
  export declare const Grid: React_2.ForwardRefExoticComponent<GridProps & React_2.RefAttributes<HTMLDivElement>>;
919
1006
 
920
1007
  export declare interface GridProps extends React_2.HTMLAttributes<HTMLDivElement> {
@@ -936,7 +1023,7 @@ export declare interface HeadingProps extends React_2.HTMLAttributes<HTMLHeading
936
1023
  }
937
1024
 
938
1025
  export declare const headingVariants: (props?: ({
939
- level?: 1 | 2 | 3 | 4 | 5 | 6 | null | undefined;
1026
+ level?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
940
1027
  } & ClassProp) | undefined) => string;
941
1028
 
942
1029
  export declare const HoverCard: React_2.FC<HoverCardPrimitive.HoverCardProps>;
@@ -947,6 +1034,57 @@ export declare const HoverCardTrigger: React_2.ForwardRefExoticComponent<HoverCa
947
1034
 
948
1035
  export declare const HStack: React_2.ForwardRefExoticComponent<StackProps & React_2.RefAttributes<HTMLDivElement>>;
949
1036
 
1037
+ declare const Image_2: React_2.ForwardRefExoticComponent<ImageProps & React_2.RefAttributes<HTMLImageElement>>;
1038
+ export { Image_2 as Image }
1039
+
1040
+ export declare const ImageCompare: React_2.ForwardRefExoticComponent<ImageCompareProps & React_2.RefAttributes<HTMLDivElement>>;
1041
+
1042
+ export declare interface ImageCompareProps extends React_2.HTMLAttributes<HTMLDivElement> {
1043
+ beforeSrc: string;
1044
+ afterSrc: string;
1045
+ beforeAlt?: string;
1046
+ afterAlt?: string;
1047
+ initialPosition?: number;
1048
+ orientation?: "horizontal" | "vertical";
1049
+ showLabels?: boolean;
1050
+ beforeLabel?: string;
1051
+ afterLabel?: string;
1052
+ handleSize?: number;
1053
+ onPositionChange?: (position: number) => void;
1054
+ }
1055
+
1056
+ export declare function ImageCropper({ src, aspectRatio, minSize, maxSize, initialCrop, outputFormat, outputQuality, onCropComplete, onCropChange, showGrid, circular, className, }: ImageCropperProps): JSX_2.Element;
1057
+
1058
+ export declare interface ImageCropperProps {
1059
+ src: string;
1060
+ aspectRatio?: number;
1061
+ minSize?: number;
1062
+ maxSize?: number;
1063
+ initialCrop?: CropArea;
1064
+ outputFormat?: "image/png" | "image/jpeg" | "image/webp";
1065
+ outputQuality?: number;
1066
+ onCropComplete?: (blob: Blob, dataUrl: string) => void;
1067
+ onCropChange?: (crop: CropArea) => void;
1068
+ showGrid?: boolean;
1069
+ circular?: boolean;
1070
+ className?: string;
1071
+ }
1072
+
1073
+ export declare interface ImageProps extends React_2.ImgHTMLAttributes<HTMLImageElement> {
1074
+ fallbackSrc?: string;
1075
+ placeholder?: React_2.ReactNode;
1076
+ showSkeleton?: boolean;
1077
+ lazy?: boolean;
1078
+ rootMargin?: string;
1079
+ aspectRatio?: string | number;
1080
+ zoomOnHover?: boolean;
1081
+ zoomScale?: number;
1082
+ zoomOnClick?: boolean;
1083
+ fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
1084
+ onLoad?: (e: React_2.SyntheticEvent<HTMLImageElement>) => void;
1085
+ onError?: (e: React_2.SyntheticEvent<HTMLImageElement>) => void;
1086
+ }
1087
+
950
1088
  export declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
951
1089
 
952
1090
  export declare interface InputProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
@@ -970,6 +1108,30 @@ export declare function Lead({ className, ...props }: LeadProps): JSX_2.Element;
970
1108
  export declare interface LeadProps extends React_2.HTMLAttributes<HTMLParagraphElement> {
971
1109
  }
972
1110
 
1111
+ export declare function Lightbox({ images, open: controlledOpen, defaultIndex, onClose, onIndexChange, enableZoom, enableKeyboard, showCounter, showThumbnails, className, children, }: LightboxProps): JSX_2.Element | null;
1112
+
1113
+ export declare interface LightboxImage {
1114
+ src: string;
1115
+ alt?: string;
1116
+ title?: string;
1117
+ description?: string;
1118
+ }
1119
+
1120
+ export declare interface LightboxProps {
1121
+ images: LightboxImage[];
1122
+ open?: boolean;
1123
+ defaultIndex?: number;
1124
+ onClose?: () => void;
1125
+ onIndexChange?: (index: number) => void;
1126
+ enableZoom?: boolean;
1127
+ enableKeyboard?: boolean;
1128
+ showCounter?: boolean;
1129
+ showThumbnails?: boolean;
1130
+ animationDuration?: number;
1131
+ className?: string;
1132
+ children?: React_2.ReactNode;
1133
+ }
1134
+
973
1135
  export declare const Main: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLElement> & React_2.RefAttributes<HTMLElement>>;
974
1136
 
975
1137
  export declare const MarkdownRenderer: React_2.ForwardRefExoticComponent<MarkdownRendererProps & React_2.RefAttributes<HTMLDivElement>>;
@@ -1195,6 +1357,65 @@ export declare interface NUILocale {
1195
1357
  carousel_previousSlide: string;
1196
1358
  carousel_nextSlide: string;
1197
1359
  breadcrumb_more: string;
1360
+ audioPlayer_play: string;
1361
+ audioPlayer_pause: string;
1362
+ audioPlayer_mute: string;
1363
+ audioPlayer_unmute: string;
1364
+ audioPlayer_seek: string;
1365
+ audioPlayer_volume: string;
1366
+ audioRecorder_startRecording: string;
1367
+ audioRecorder_stopRecording: string;
1368
+ audioRecorder_pauseRecording: string;
1369
+ audioRecorder_resumeRecording: string;
1370
+ audioRecorder_reRecord: string;
1371
+ audioRecorder_microphoneAccess: string;
1372
+ audioWaveform_label: string;
1373
+ audioPlaylist_shuffle: string;
1374
+ audioPlaylist_repeatOff: string;
1375
+ audioPlaylist_repeatAll: string;
1376
+ audioPlaylist_repeatOne: string;
1377
+ audioPlaylist_previousTrack: string;
1378
+ audioPlaylist_nextTrack: string;
1379
+ /** Use {current} and {total} placeholders */
1380
+ audioPlaylist_trackOf: string;
1381
+ videoPlayer_play: string;
1382
+ videoPlayer_pause: string;
1383
+ videoPlayer_mute: string;
1384
+ videoPlayer_unmute: string;
1385
+ videoPlayer_seek: string;
1386
+ videoPlayer_volume: string;
1387
+ videoPlayer_fullscreen: string;
1388
+ videoPlayer_exitFullscreen: string;
1389
+ videoPlayer_pictureInPicture: string;
1390
+ videoPlayer_playbackSpeed: string;
1391
+ videoPlayer_subtitles: string;
1392
+ videoPlayer_label: string;
1393
+ videoRecorder_startCamera: string;
1394
+ videoRecorder_shareScreen: string;
1395
+ videoRecorder_startRecording: string;
1396
+ videoRecorder_stopRecording: string;
1397
+ videoRecorder_pauseRecording: string;
1398
+ videoRecorder_resumeRecording: string;
1399
+ videoRecorder_reRecord: string;
1400
+ videoRecorder_cameraPreview: string;
1401
+ videoRecorder_screenPreview: string;
1402
+ /** Use {title} placeholder */
1403
+ videoThumbnail_play: string;
1404
+ videoGallery_label: string;
1405
+ image_loading: string;
1406
+ image_zoomIn: string;
1407
+ image_failedToLoad: string;
1408
+ lightbox_label: string;
1409
+ lightbox_zoomIn: string;
1410
+ lightbox_zoomOut: string;
1411
+ /** Use {current} and {total} placeholders */
1412
+ lightbox_imageOf: string;
1413
+ imageCropper_label: string;
1414
+ imageCropper_crop: string;
1415
+ imageCropper_reset: string;
1416
+ imageCompare_slider: string;
1417
+ imageCompare_before: string;
1418
+ imageCompare_after: string;
1198
1419
  }
1199
1420
 
1200
1421
  export declare function NumberInput({ value, onChange, min, max, step, disabled, className, }: NumberInputProps): JSX_2.Element;
@@ -1295,6 +1516,11 @@ export declare interface ReasoningBlockProps extends React_2.HTMLAttributes<HTML
1295
1516
  title?: string;
1296
1517
  }
1297
1518
 
1519
+ declare type RecordingState_2 = "idle" | "recording" | "paused" | "stopped";
1520
+ export { RecordingState_2 as RecordingState }
1521
+
1522
+ export declare type RepeatMode = "none" | "all" | "one";
1523
+
1298
1524
  export declare const ru: NUILocale;
1299
1525
 
1300
1526
  export declare const ScrollArea: React_2.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
@@ -1677,6 +1903,96 @@ declare function useTranslate(): NUILocale;
1677
1903
  export { useTranslate as useNUILocale }
1678
1904
  export { useTranslate }
1679
1905
 
1906
+ export declare const VideoGallery: React_2.ForwardRefExoticComponent<VideoGalleryProps & React_2.RefAttributes<HTMLDivElement>>;
1907
+
1908
+ export declare interface VideoGalleryItem {
1909
+ id: string;
1910
+ src: string;
1911
+ poster?: string;
1912
+ title?: string;
1913
+ duration?: number;
1914
+ description?: string;
1915
+ }
1916
+
1917
+ export declare interface VideoGalleryProps extends React_2.HTMLAttributes<HTMLDivElement> {
1918
+ videos: VideoGalleryItem[];
1919
+ columns?: number | {
1920
+ sm?: number;
1921
+ md?: number;
1922
+ lg?: number;
1923
+ xl?: number;
1924
+ };
1925
+ gap?: number;
1926
+ aspectRatio?: string;
1927
+ clickAction?: "lightbox" | "inline" | "dialog" | "none";
1928
+ onVideoSelect?: (video: VideoGalleryItem, index: number) => void;
1929
+ }
1930
+
1931
+ export declare function VideoPlayer({ src, poster, showControls, controlsTimeout, enablePiP, enableFullscreen, enablePlaybackRate, playbackRates, tracks, aspectRatio, autoPlay, loop, muted: mutedProp, preload, onPlay, onPause, onEnded, onTimeUpdate, onFullscreenChange, className, }: VideoPlayerProps): JSX_2.Element;
1932
+
1933
+ export declare interface VideoPlayerProps {
1934
+ src: string;
1935
+ poster?: string;
1936
+ showControls?: boolean;
1937
+ controlsTimeout?: number;
1938
+ enablePiP?: boolean;
1939
+ enableFullscreen?: boolean;
1940
+ enablePlaybackRate?: boolean;
1941
+ playbackRates?: number[];
1942
+ tracks?: VideoTrack[];
1943
+ aspectRatio?: string;
1944
+ autoPlay?: boolean;
1945
+ loop?: boolean;
1946
+ muted?: boolean;
1947
+ preload?: "none" | "metadata" | "auto";
1948
+ onPlay?: () => void;
1949
+ onPause?: () => void;
1950
+ onEnded?: () => void;
1951
+ onTimeUpdate?: (currentTime: number) => void;
1952
+ onFullscreenChange?: (isFullscreen: boolean) => void;
1953
+ className?: string;
1954
+ }
1955
+
1956
+ export declare function VideoRecorder({ source, videoConstraints, audioConstraints, mimeType, maxDuration, showTimer, mirrored, onRecordingComplete, onRecordingStart, onError, className, }: VideoRecorderProps): JSX_2.Element;
1957
+
1958
+ export declare interface VideoRecorderProps {
1959
+ source?: "camera" | "screen";
1960
+ videoConstraints?: MediaTrackConstraints;
1961
+ audioConstraints?: boolean | MediaTrackConstraints;
1962
+ mimeType?: string;
1963
+ maxDuration?: number;
1964
+ showTimer?: boolean;
1965
+ mirrored?: boolean;
1966
+ onRecordingComplete?: (blob: Blob) => void;
1967
+ onRecordingStart?: () => void;
1968
+ onError?: (error: Error) => void;
1969
+ className?: string;
1970
+ }
1971
+
1972
+ export declare type VideoRecordingState = "idle" | "preview" | "recording" | "paused" | "stopped";
1973
+
1974
+ export declare const VideoThumbnail: React_2.ForwardRefExoticComponent<VideoThumbnailProps & React_2.RefAttributes<HTMLDivElement>>;
1975
+
1976
+ export declare interface VideoThumbnailProps extends React_2.HTMLAttributes<HTMLDivElement> {
1977
+ src: string;
1978
+ poster?: string;
1979
+ title?: string;
1980
+ duration?: number;
1981
+ clickAction?: "inline" | "dialog" | "none";
1982
+ aspectRatio?: string;
1983
+ showDuration?: boolean;
1984
+ showPlayButton?: boolean;
1985
+ onPlay?: () => void;
1986
+ }
1987
+
1988
+ export declare interface VideoTrack {
1989
+ src: string;
1990
+ kind: "subtitles" | "captions";
1991
+ srcLang: string;
1992
+ label: string;
1993
+ default?: boolean;
1994
+ }
1995
+
1680
1996
  export declare const VStack: React_2.ForwardRefExoticComponent<StackProps & React_2.RefAttributes<HTMLDivElement>>;
1681
1997
 
1682
1998
  export { }