@nicorp/nui 0.10.0 → 0.11.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.
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;
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,58 @@ 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, onError, 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
+ onError?: (error: Error) => void;
1069
+ showGrid?: boolean;
1070
+ circular?: boolean;
1071
+ className?: string;
1072
+ }
1073
+
1074
+ export declare interface ImageProps extends React_2.ImgHTMLAttributes<HTMLImageElement> {
1075
+ fallbackSrc?: string;
1076
+ placeholder?: React_2.ReactNode;
1077
+ showSkeleton?: boolean;
1078
+ lazy?: boolean;
1079
+ rootMargin?: string;
1080
+ aspectRatio?: string | number;
1081
+ zoomOnHover?: boolean;
1082
+ zoomScale?: number;
1083
+ zoomOnClick?: boolean;
1084
+ fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
1085
+ onLoad?: (e: React_2.SyntheticEvent<HTMLImageElement>) => void;
1086
+ onError?: (e: React_2.SyntheticEvent<HTMLImageElement>) => void;
1087
+ }
1088
+
950
1089
  export declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
951
1090
 
952
1091
  export declare interface InputProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
@@ -970,6 +1109,30 @@ export declare function Lead({ className, ...props }: LeadProps): JSX_2.Element;
970
1109
  export declare interface LeadProps extends React_2.HTMLAttributes<HTMLParagraphElement> {
971
1110
  }
972
1111
 
1112
+ export declare function Lightbox({ images, open: controlledOpen, defaultIndex, onClose, onIndexChange, enableZoom, enableKeyboard, showCounter, showThumbnails, className, children, }: LightboxProps): JSX_2.Element | null;
1113
+
1114
+ export declare interface LightboxImage {
1115
+ src: string;
1116
+ alt?: string;
1117
+ title?: string;
1118
+ description?: string;
1119
+ }
1120
+
1121
+ export declare interface LightboxProps {
1122
+ images: LightboxImage[];
1123
+ open?: boolean;
1124
+ defaultIndex?: number;
1125
+ onClose?: () => void;
1126
+ onIndexChange?: (index: number) => void;
1127
+ enableZoom?: boolean;
1128
+ enableKeyboard?: boolean;
1129
+ showCounter?: boolean;
1130
+ showThumbnails?: boolean;
1131
+ animationDuration?: number;
1132
+ className?: string;
1133
+ children?: React_2.ReactNode;
1134
+ }
1135
+
973
1136
  export declare const Main: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLElement> & React_2.RefAttributes<HTMLElement>>;
974
1137
 
975
1138
  export declare const MarkdownRenderer: React_2.ForwardRefExoticComponent<MarkdownRendererProps & React_2.RefAttributes<HTMLDivElement>>;
@@ -1195,6 +1358,69 @@ export declare interface NUILocale {
1195
1358
  carousel_previousSlide: string;
1196
1359
  carousel_nextSlide: string;
1197
1360
  breadcrumb_more: string;
1361
+ audioPlayer_play: string;
1362
+ audioPlayer_pause: string;
1363
+ audioPlayer_mute: string;
1364
+ audioPlayer_unmute: string;
1365
+ audioPlayer_seek: string;
1366
+ audioPlayer_volume: string;
1367
+ audioPlayer_error: string;
1368
+ audioRecorder_startRecording: string;
1369
+ audioRecorder_stopRecording: string;
1370
+ audioRecorder_pauseRecording: string;
1371
+ audioRecorder_resumeRecording: string;
1372
+ audioRecorder_reRecord: string;
1373
+ audioRecorder_microphoneAccess: string;
1374
+ audioWaveform_label: string;
1375
+ audioWaveform_error: string;
1376
+ audioPlaylist_shuffle: string;
1377
+ audioPlaylist_repeatOff: string;
1378
+ audioPlaylist_repeatAll: string;
1379
+ audioPlaylist_repeatOne: string;
1380
+ audioPlaylist_previousTrack: string;
1381
+ audioPlaylist_nextTrack: string;
1382
+ /** Use {current} and {total} placeholders */
1383
+ audioPlaylist_trackOf: string;
1384
+ audioPlaylist_empty: string;
1385
+ videoPlayer_play: string;
1386
+ videoPlayer_pause: string;
1387
+ videoPlayer_mute: string;
1388
+ videoPlayer_unmute: string;
1389
+ videoPlayer_seek: string;
1390
+ videoPlayer_volume: string;
1391
+ videoPlayer_fullscreen: string;
1392
+ videoPlayer_exitFullscreen: string;
1393
+ videoPlayer_pictureInPicture: string;
1394
+ videoPlayer_playbackSpeed: string;
1395
+ videoPlayer_subtitles: string;
1396
+ videoPlayer_label: string;
1397
+ videoRecorder_startCamera: string;
1398
+ videoRecorder_shareScreen: string;
1399
+ videoRecorder_startRecording: string;
1400
+ videoRecorder_stopRecording: string;
1401
+ videoRecorder_pauseRecording: string;
1402
+ videoRecorder_resumeRecording: string;
1403
+ videoRecorder_reRecord: string;
1404
+ videoRecorder_cameraPreview: string;
1405
+ videoRecorder_screenPreview: string;
1406
+ /** Use {title} placeholder */
1407
+ videoThumbnail_play: string;
1408
+ videoGallery_label: string;
1409
+ image_loading: string;
1410
+ image_zoomIn: string;
1411
+ image_failedToLoad: string;
1412
+ lightbox_label: string;
1413
+ lightbox_zoomIn: string;
1414
+ lightbox_zoomOut: string;
1415
+ /** Use {current} and {total} placeholders */
1416
+ lightbox_imageOf: string;
1417
+ imageCropper_label: string;
1418
+ imageCropper_crop: string;
1419
+ imageCropper_reset: string;
1420
+ imageCropper_cropFailed: string;
1421
+ imageCompare_slider: string;
1422
+ imageCompare_before: string;
1423
+ imageCompare_after: string;
1198
1424
  }
1199
1425
 
1200
1426
  export declare function NumberInput({ value, onChange, min, max, step, disabled, className, }: NumberInputProps): JSX_2.Element;
@@ -1295,6 +1521,11 @@ export declare interface ReasoningBlockProps extends React_2.HTMLAttributes<HTML
1295
1521
  title?: string;
1296
1522
  }
1297
1523
 
1524
+ declare type RecordingState_2 = "idle" | "recording" | "paused" | "stopped";
1525
+ export { RecordingState_2 as RecordingState }
1526
+
1527
+ export declare type RepeatMode = "none" | "all" | "one";
1528
+
1298
1529
  export declare const ru: NUILocale;
1299
1530
 
1300
1531
  export declare const ScrollArea: React_2.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
@@ -1677,6 +1908,96 @@ declare function useTranslate(): NUILocale;
1677
1908
  export { useTranslate as useNUILocale }
1678
1909
  export { useTranslate }
1679
1910
 
1911
+ export declare const VideoGallery: React_2.ForwardRefExoticComponent<VideoGalleryProps & React_2.RefAttributes<HTMLDivElement>>;
1912
+
1913
+ export declare interface VideoGalleryItem {
1914
+ id: string;
1915
+ src: string;
1916
+ poster?: string;
1917
+ title?: string;
1918
+ duration?: number;
1919
+ description?: string;
1920
+ }
1921
+
1922
+ export declare interface VideoGalleryProps extends React_2.HTMLAttributes<HTMLDivElement> {
1923
+ videos: VideoGalleryItem[];
1924
+ columns?: number | {
1925
+ sm?: number;
1926
+ md?: number;
1927
+ lg?: number;
1928
+ xl?: number;
1929
+ };
1930
+ gap?: number;
1931
+ aspectRatio?: string;
1932
+ clickAction?: "lightbox" | "inline" | "dialog" | "none";
1933
+ onVideoSelect?: (video: VideoGalleryItem, index: number) => void;
1934
+ }
1935
+
1936
+ 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;
1937
+
1938
+ export declare interface VideoPlayerProps {
1939
+ src: string;
1940
+ poster?: string;
1941
+ showControls?: boolean;
1942
+ controlsTimeout?: number;
1943
+ enablePiP?: boolean;
1944
+ enableFullscreen?: boolean;
1945
+ enablePlaybackRate?: boolean;
1946
+ playbackRates?: number[];
1947
+ tracks?: VideoTrack[];
1948
+ aspectRatio?: string;
1949
+ autoPlay?: boolean;
1950
+ loop?: boolean;
1951
+ muted?: boolean;
1952
+ preload?: "none" | "metadata" | "auto";
1953
+ onPlay?: () => void;
1954
+ onPause?: () => void;
1955
+ onEnded?: () => void;
1956
+ onTimeUpdate?: (currentTime: number) => void;
1957
+ onFullscreenChange?: (isFullscreen: boolean) => void;
1958
+ className?: string;
1959
+ }
1960
+
1961
+ export declare function VideoRecorder({ source, videoConstraints, audioConstraints, mimeType, maxDuration, showTimer, mirrored, onRecordingComplete, onRecordingStart, onError, className, }: VideoRecorderProps): JSX_2.Element;
1962
+
1963
+ export declare interface VideoRecorderProps {
1964
+ source?: "camera" | "screen";
1965
+ videoConstraints?: MediaTrackConstraints;
1966
+ audioConstraints?: boolean | MediaTrackConstraints;
1967
+ mimeType?: string;
1968
+ maxDuration?: number;
1969
+ showTimer?: boolean;
1970
+ mirrored?: boolean;
1971
+ onRecordingComplete?: (blob: Blob) => void;
1972
+ onRecordingStart?: () => void;
1973
+ onError?: (error: Error) => void;
1974
+ className?: string;
1975
+ }
1976
+
1977
+ export declare type VideoRecordingState = "idle" | "preview" | "recording" | "paused" | "stopped";
1978
+
1979
+ export declare const VideoThumbnail: React_2.ForwardRefExoticComponent<VideoThumbnailProps & React_2.RefAttributes<HTMLDivElement>>;
1980
+
1981
+ export declare interface VideoThumbnailProps extends React_2.HTMLAttributes<HTMLDivElement> {
1982
+ src: string;
1983
+ poster?: string;
1984
+ title?: string;
1985
+ duration?: number;
1986
+ clickAction?: "inline" | "dialog" | "none";
1987
+ aspectRatio?: string;
1988
+ showDuration?: boolean;
1989
+ showPlayButton?: boolean;
1990
+ onPlay?: () => void;
1991
+ }
1992
+
1993
+ export declare interface VideoTrack {
1994
+ src: string;
1995
+ kind: "subtitles" | "captions";
1996
+ srcLang: string;
1997
+ label: string;
1998
+ default?: boolean;
1999
+ }
2000
+
1680
2001
  export declare const VStack: React_2.ForwardRefExoticComponent<StackProps & React_2.RefAttributes<HTMLDivElement>>;
1681
2002
 
1682
2003
  export { }