@fibrae/semi-ui-svelte 0.9.0 → 0.10.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.
Files changed (169) hide show
  1. package/README.md +8 -4
  2. package/README.zh-CN.md +8 -4
  3. package/dist/components/anchor/interface.d.ts +14 -0
  4. package/dist/components/audio-player/interface.d.ts +5 -0
  5. package/dist/components/auto-complete/interface.d.ts +29 -0
  6. package/dist/components/avatar/interface.d.ts +24 -0
  7. package/dist/components/backtop/interface.d.ts +2 -0
  8. package/dist/components/badge/interface.d.ts +7 -0
  9. package/dist/components/banner/interface.d.ts +7 -0
  10. package/dist/components/breadcrumb/interface.d.ts +10 -0
  11. package/dist/components/button/interface.d.ts +18 -0
  12. package/dist/components/calendar/interface.d.ts +16 -0
  13. package/dist/components/card/interface.d.ts +18 -0
  14. package/dist/components/carousel/interface.d.ts +16 -0
  15. package/dist/components/cascader/cascader.svelte +1 -0
  16. package/dist/components/cascader/interface.d.ts +57 -0
  17. package/dist/components/checkbox/interface.d.ts +19 -0
  18. package/dist/components/code-highlight/interface.d.ts +3 -0
  19. package/dist/components/collapse/interface.d.ts +16 -0
  20. package/dist/components/collapsible/interface.d.ts +10 -0
  21. package/dist/components/color-picker/interface.d.ts +10 -0
  22. package/dist/components/config-provider/interface.d.ts +7 -0
  23. package/dist/components/cropper/interface.d.ts +11 -0
  24. package/dist/components/date-picker/interface.d.ts +47 -0
  25. package/dist/components/descriptions/interface.d.ts +6 -0
  26. package/dist/components/divider/interface.d.ts +4 -0
  27. package/dist/components/dropdown/interface.d.ts +8 -0
  28. package/dist/components/empty/interface.d.ts +7 -0
  29. package/dist/components/feedback/interface.d.ts +16 -0
  30. package/dist/components/float-button/interface.d.ts +14 -0
  31. package/dist/components/form/interface.d.ts +47 -0
  32. package/dist/components/form/label.svelte +2 -2
  33. package/dist/components/grid/interface.d.ts +13 -0
  34. package/dist/components/highlight/interface.d.ts +7 -0
  35. package/dist/components/hot-keys/interface.d.ts +3 -0
  36. package/dist/components/image/interface.d.ts +59 -0
  37. package/dist/components/input/interface.d.ts +67 -0
  38. package/dist/components/input-number/interface.d.ts +24 -0
  39. package/dist/components/json-viewer/interface.d.ts +7 -0
  40. package/dist/components/layout/interface.d.ts +3 -0
  41. package/dist/components/list/interface.d.ts +18 -0
  42. package/dist/components/locale/interface.d.ts +4 -0
  43. package/dist/components/lottie/interface.d.ts +2 -0
  44. package/dist/components/markdown-render/interface.d.ts +5 -0
  45. package/dist/components/modal/interface.d.ts +29 -0
  46. package/dist/components/navigation/interface.d.ts +47 -0
  47. package/dist/components/overflow-list/interface.d.ts +11 -0
  48. package/dist/components/pagination/interface.d.ts +12 -0
  49. package/dist/components/pincode/interface.d.ts +8 -0
  50. package/dist/components/popconfirm/interface.d.ts +12 -0
  51. package/dist/components/popover/interface.d.ts +30 -0
  52. package/dist/components/progress/interface.d.ts +13 -0
  53. package/dist/components/radio/interface.d.ts +22 -0
  54. package/dist/components/rating/interface.d.ts +12 -0
  55. package/dist/components/resizable/interface.d.ts +30 -0
  56. package/dist/components/scroll-list/interface.d.ts +6 -0
  57. package/dist/components/select/interface.d.ts +63 -0
  58. package/dist/components/side-sheet/interface.d.ts +19 -0
  59. package/dist/components/skeleton/interface.d.ts +7 -0
  60. package/dist/components/slider/interface.d.ts +23 -0
  61. package/dist/components/space/interface.d.ts +4 -0
  62. package/dist/components/spin/interface.d.ts +7 -0
  63. package/dist/components/steps/interface.d.ts +9 -0
  64. package/dist/components/switch/interface.d.ts +7 -0
  65. package/dist/components/table/interface.d.ts +48 -0
  66. package/dist/components/tabs/interface.d.ts +29 -0
  67. package/dist/components/tag/interface.d.ts +22 -0
  68. package/dist/components/tag-input/interface.d.ts +29 -0
  69. package/dist/components/time-picker/interface.d.ts +31 -0
  70. package/dist/components/timeline/interface.d.ts +5 -0
  71. package/dist/components/tooltip/interface.d.ts +20 -0
  72. package/dist/components/tooltip/tooltip.svelte +3 -0
  73. package/dist/components/transfer/interface.d.ts +18 -0
  74. package/dist/components/tree/interface.d.ts +45 -0
  75. package/dist/components/tree-select/interface.d.ts +55 -0
  76. package/dist/components/typography/interface.d.ts +33 -0
  77. package/dist/components/upload/interface.d.ts +64 -0
  78. package/dist/components/user-guide/interface.d.ts +15 -0
  79. package/dist/components/video-player/interface.d.ts +22 -0
  80. package/dist/styles.css +1 -1
  81. package/docs/advanced/dark-mode.md +288 -0
  82. package/docs/basic/button.md +605 -0
  83. package/docs/basic/divider.md +103 -0
  84. package/docs/basic/float-button.md +246 -0
  85. package/docs/basic/grid.md +427 -0
  86. package/docs/basic/layout.md +459 -0
  87. package/docs/basic/resizable.md +584 -0
  88. package/docs/basic/space.md +163 -0
  89. package/docs/basic/tokens.md +425 -0
  90. package/docs/basic/typography.md +615 -0
  91. package/docs/changes-from-semi.md +105 -0
  92. package/docs/ecosystem/tailwind.md +210 -0
  93. package/docs/experience/accessibility.md +82 -0
  94. package/docs/experience/content-guidelines.md +819 -0
  95. package/docs/experience/internationalization.md +7 -0
  96. package/docs/feedback/banner.md +198 -0
  97. package/docs/feedback/feedback.md +294 -0
  98. package/docs/feedback/notification.md +401 -0
  99. package/docs/feedback/popconfirm.md +243 -0
  100. package/docs/feedback/progress.md +389 -0
  101. package/docs/feedback/skeleton.md +388 -0
  102. package/docs/feedback/spin.md +172 -0
  103. package/docs/feedback/toast.md +393 -0
  104. package/docs/input/auto-complete.md +399 -0
  105. package/docs/input/cascader.md +1558 -0
  106. package/docs/input/checkbox.md +408 -0
  107. package/docs/input/color-picker.md +175 -0
  108. package/docs/input/date-picker.md +942 -0
  109. package/docs/input/form.md +2550 -0
  110. package/docs/input/input-number.md +451 -0
  111. package/docs/input/input.md +640 -0
  112. package/docs/input/pincode.md +191 -0
  113. package/docs/input/radio.md +337 -0
  114. package/docs/input/rating.md +214 -0
  115. package/docs/input/select.md +1230 -0
  116. package/docs/input/slider.md +347 -0
  117. package/docs/input/switch.md +206 -0
  118. package/docs/input/tag-input.md +465 -0
  119. package/docs/input/time-picker.md +358 -0
  120. package/docs/input/transfer.md +1061 -0
  121. package/docs/input/tree-select.md +1300 -0
  122. package/docs/input/upload.md +1811 -0
  123. package/docs/llms.txt +147 -0
  124. package/docs/navigation/anchor.md +377 -0
  125. package/docs/navigation/backtop.md +100 -0
  126. package/docs/navigation/breadcrumb.md +284 -0
  127. package/docs/navigation/navigation.md +851 -0
  128. package/docs/navigation/pagination.md +217 -0
  129. package/docs/navigation/steps.md +315 -0
  130. package/docs/navigation/tabs.md +754 -0
  131. package/docs/navigation/tree.md +1956 -0
  132. package/docs/other/config-provider.md +599 -0
  133. package/docs/other/locale.md +353 -0
  134. package/docs/plus/audio-player.md +155 -0
  135. package/docs/plus/code-highlight.md +150 -0
  136. package/docs/plus/drag-move.md +214 -0
  137. package/docs/plus/hot-keys.md +174 -0
  138. package/docs/plus/json-viewer.md +392 -0
  139. package/docs/plus/lottie.md +176 -0
  140. package/docs/plus/markdown-render.md +240 -0
  141. package/docs/plus/video-player.md +325 -0
  142. package/docs/show/avatar.md +475 -0
  143. package/docs/show/badge.md +276 -0
  144. package/docs/show/calendar.md +352 -0
  145. package/docs/show/card.md +485 -0
  146. package/docs/show/carousel.md +592 -0
  147. package/docs/show/collapse.md +289 -0
  148. package/docs/show/collapsible.md +216 -0
  149. package/docs/show/cropper.md +285 -0
  150. package/docs/show/descriptions.md +325 -0
  151. package/docs/show/dropdown.md +466 -0
  152. package/docs/show/empty.md +225 -0
  153. package/docs/show/highlight.md +144 -0
  154. package/docs/show/image.md +433 -0
  155. package/docs/show/list.md +927 -0
  156. package/docs/show/modal.md +517 -0
  157. package/docs/show/overflow-list.md +272 -0
  158. package/docs/show/popover.md +534 -0
  159. package/docs/show/scroll-list.md +156 -0
  160. package/docs/show/side-sheet.md +274 -0
  161. package/docs/show/table.md +5437 -0
  162. package/docs/show/tag.md +428 -0
  163. package/docs/show/timeline.md +277 -0
  164. package/docs/show/tooltip.md +442 -0
  165. package/docs/show/user-guide.md +419 -0
  166. package/docs/start/getting-started.md +234 -0
  167. package/docs/start/introduction.md +57 -0
  168. package/docs/start/overview.md +21 -0
  169. package/package.json +5 -4
@@ -110,92 +110,142 @@ export interface UploadHandle {
110
110
  }
111
111
  /** The snippets a card renders; Upload forwards its own of the same names to each card */
112
112
  export interface FileCardSnippets {
113
+ /** Custom preview that replaces the thumbnail. Only applies in list mode. It does not fall back to the default thumbnail when empty. */
113
114
  previewFile?: Snippet<[UploadFileItemSlotProps]>;
115
+ /** Custom picture wall thumbnail. Only applies in picture mode. */
114
116
  thumbnail?: Snippet<[UploadFileItemSlotProps]>;
117
+ /** Custom picture wall information. Only applies in picture mode with showPicInfo set to true. */
115
118
  picInfo?: Snippet<[UploadFileItemSlotProps]>;
119
+ /** Custom preview icon shown on hover in the picture wall. Only applies in picture mode. */
116
120
  picPreviewIcon?: Snippet<[UploadFileItemSlotProps]>;
121
+ /** Custom close button of the picture wall, with class and onRemove. Only applies in picture mode. */
117
122
  picClose?: Snippet<[UploadPicCloseSlotProps]>;
123
+ /** Custom operation area of a list item. */
118
124
  fileOperation?: Snippet<[UploadFileItemSlotProps]>;
119
125
  /** Replaces a card's validate message, which the snippet gets as `validateMessage` */
120
126
  fileValidateMessage?: Snippet<[UploadFileItemSlotProps]>;
127
+ /** Custom popup content for a truncated file name, with content and trigger; trigger is the file name element to place in the popup. */
121
128
  ellipsisTooltip?: Snippet<[TypographyEllipsisTooltipProps]>;
122
129
  }
123
130
  export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange' | 'ondrop' | 'onerror' | 'onprogress' | 'children'>, FileCardSnippets {
131
+ /** Accepted file types, written like the accept attribute of input: file extensions such as `.jpg` or MIME types, separated by commas. */
124
132
  accept?: string;
133
+ /** Upload URL. Required. */
125
134
  action: string;
126
135
  /** Adds the files pasted anywhere on the page */
127
136
  addOnPasting?: boolean;
137
+ /** Hook after an upload completes without error. The returned object updates the file status, validate message, name and preview URL. Async results are not supported. */
128
138
  afterUpload?: (object: AfterUploadProps) => AfterUploadResult;
139
+ /** Called before the list is cleared. Returning false, or a Promise that resolves to false or rejects, blocks the clear. */
129
140
  beforeClear?: (fileList: FileItem[]) => boolean | Promise<boolean>;
130
141
  /**
131
142
  * Called once, with the first selected image, before the crop modal opens; its result decides cropping for the
132
143
  * whole batch. `false` (or a Promise resolving to it) uploads without cropping.
133
144
  */
134
145
  beforeCrop?: (file: File, fileList: File[]) => boolean | Promise<boolean>;
146
+ /** Called before a file is removed. Returning false, or a Promise that resolves to false or rejects, blocks the removal. */
135
147
  beforeRemove?: (file: FileItem, fileList: FileItem[]) => boolean | Promise<boolean>;
148
+ /** Hook before a file is uploaded. The returned object updates the file status and decides whether to upload. A boolean means pass or fail; for a Promise, resolve passes and reject fails. */
136
149
  beforeUpload?: (object: BeforeUploadProps) => BeforeUploadObjectResult | Promise<BeforeUploadObjectResult> | boolean;
150
+ /** How media is captured: user or environment. true renders the attribute with an empty value, false omits it. */
137
151
  capture?: boolean | 'user' | 'environment';
152
+ /** Class names of the inner parts, keyed by `item` (each file card); merged with the built-in classes. */
138
153
  classNames?: Partial<Record<UploadPart, ClassValue>>;
139
154
  /** `true` crops with the defaults; an object configures the cropper */
140
155
  crop?: boolean | UploadCropProps;
156
+ /** Props of the crop Modal. visible, title, okText, cancelText, onOk, onCancel and children belong to Upload; style and every value of styles are style strings. */
141
157
  cropModalProps?: UploadCropModalProps;
142
158
  /** Replaces the built-in XMLHttpRequest */
143
159
  customRequest?: (object: UploadCustomRequestArgs) => void;
160
+ /** Extra parameters sent with the upload, or a function that returns them for a file. */
144
161
  data?: Record<string, any> | ((file: File) => Record<string, unknown>);
162
+ /** Whether to upload a folder. */
145
163
  directory?: boolean;
164
+ /** Whether Upload is disabled. A disabled Upload no longer shows the remove, retry, replace and clear actions. */
146
165
  disabled?: boolean;
166
+ /** Whether dragging files to upload is supported. */
147
167
  draggable?: boolean;
148
168
  /** Bindable; the list on screen. `undefined` leaves the list to the component */
149
169
  fileList?: FileItem[];
170
+ /** Same as name. Mainly used in FormUpload to avoid clashing with the name of Field. */
150
171
  fileName?: string;
172
+ /** Headers sent with the upload, or a function that returns them for a file. */
151
173
  headers?: Record<string, any> | ((file: File) => Record<string, string>);
152
174
  /** Where the picture wall's add button sits */
153
175
  hotSpotLocation?: 'start' | 'end';
176
+ /** Maximum number of files. With 1, the newest file always replaces the current one and onExceed is not called. */
154
177
  limit?: number;
178
+ /** How the file list is displayed: list, picture or none. none renders no file list, only the trigger area. */
155
179
  listType?: UploadListType;
156
180
  /** KB */
157
181
  maxSize?: number;
158
182
  /** KB */
159
183
  minSize?: number;
184
+ /** Whether several files can be selected at once. */
160
185
  multiple?: boolean;
186
+ /** Field name used for the file when uploading. */
161
187
  name?: string;
188
+ /** Display height of the pictures in picture mode. */
162
189
  picHeight?: string | number;
190
+ /** Display width of the pictures in picture mode. */
163
191
  picWidth?: string | number;
192
+ /** Position of the prompt: left, right or bottom. In list mode it is relative to the trigger, in picture mode to the picture list. */
164
193
  promptPosition?: PromptPositionType;
194
+ /** In list mode, whether to show the clear button when limit is not 1 and there is at least one file. */
165
195
  showClear?: boolean;
196
+ /** Whether to show picture information. Only applies in picture mode. */
166
197
  showPicInfo?: boolean;
198
+ /** Whether the file card shows a replace button after a successful upload. */
167
199
  showReplace?: boolean;
200
+ /** Whether the file card shows a retry button when the upload fails. */
168
201
  showRetry?: boolean;
169
202
  /** Tooltip of a truncated file name; its custom popup is the `ellipsisTooltip` snippet */
170
203
  showTooltip?: boolean | ShowTooltip;
204
+ /** Whether to show the file list. */
171
205
  showUploadList?: boolean;
206
+ /** Style strings of the inner parts, keyed like classNames; in the picture wall `item` is merged with picWidth and picHeight, and the latter win. */
172
207
  styles?: Partial<Record<UploadPart, string>>;
208
+ /** Called after a file is selected and before it is uploaded; returns the File to upload. */
173
209
  transformFile?: (file: File) => File;
210
+ /** When uploading starts: auto uploads on selection, custom waits for the upload method. */
174
211
  uploadTrigger?: 'auto' | 'custom';
212
+ /** Validation status, which styles the root element: default, error, warning or success. */
175
213
  validateStatus?: ValidateStatus;
214
+ /** Whether the upload request carries cookies. */
176
215
  withCredentials?: boolean;
177
216
  /** While present the cards are clickable and get a preview button */
178
217
  onPreviewClick?: (fileItem: FileItem) => void;
179
218
  /** `change` of the Upload, not the native event of the hidden input */
180
219
  onChange?: (object: UploadOnChangeProps) => void;
220
+ /** Called when received files do not match accept, with those files. */
181
221
  onAcceptInvalid?: (files: File[]) => void;
222
+ /** Called after the list is cleared. */
182
223
  onClear?: () => void;
224
+ /** Called when cropping an image fails. */
183
225
  onCropError?: (error: Error) => void;
226
+ /** Called when a dragged element is released on the drag area, with the native drop event, the dropped files and the current file list. */
184
227
  onDrop?: (e: DragEvent, files: File[], fileList: FileItem[]) => void;
185
228
  /** `xhr` is the object a customRequest passed to its onError */
186
229
  onError?: (e: UploadCustomError, file: CustomFile, fileList: FileItem[], xhr: XMLHttpRequest | {
187
230
  status?: number;
188
231
  }) => void;
232
+ /** Called when the total number of files exceeds limit, with the originally selected files before truncation. */
189
233
  onExceed?: (fileList: File[]) => void;
234
+ /** Called after files are selected. */
190
235
  onFileChange?: (files: File[]) => void;
236
+ /** Called when the system file dialog opens. */
191
237
  onOpenFileDialog?: () => void;
192
238
  /** A pasted clipboard file could not be read */
193
239
  onPastingError?: (error: Error) => void;
240
+ /** Called while uploading, with the percentage, the file and the current file list. */
194
241
  onProgress?: (percent: number, file: CustomFile, fileList: FileItem[]) => void;
195
242
  /** `currentFile` is undefined for an item that came without its File, e.g. from an initial fileList */
196
243
  onRemove?: (currentFile: CustomFile | undefined, fileList: FileItem[], currentFileItem: FileItem) => void;
244
+ /** Called when retry is clicked. */
197
245
  onRetry?: (fileItem: FileItem) => void;
246
+ /** Called when a file size violates maxSize or minSize. */
198
247
  onSizeError?: (file: CustomFile, fileList: FileItem[]) => void;
248
+ /** Called after a successful upload, with the server response, the file and the current file list. */
199
249
  onSuccess?: (responseBody: any, file: CustomFile, fileList: FileItem[]) => void;
200
250
  /** The trigger content; in draggable mode it replaces the whole default drag area content */
201
251
  children?: Snippet;
@@ -203,8 +253,11 @@ export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'oncha
203
253
  dragIcon?: Snippet;
204
254
  /** Falls back to the locale text */
205
255
  dragMainText?: Snippet;
256
+ /** Help text of the drag area. */
206
257
  dragSubText?: Snippet;
258
+ /** Prompt text. Unlike content in children, clicking it does not trigger an upload. */
207
259
  prompt?: Snippet;
260
+ /** Validate message of the whole Upload. */
208
261
  validateMessage?: Snippet;
209
262
  /** Replaces the list title text; the clear button stays */
210
263
  fileListTitle?: Snippet;
@@ -214,23 +267,34 @@ export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'oncha
214
267
  fileItem?: Snippet<[UploadFileItemSlotProps]>;
215
268
  }
216
269
  export interface FileCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>, FileCardSnippets {
270
+ /** The file to show. Required. */
217
271
  file: FileItem;
272
+ /** Position of the file in the list. */
218
273
  index?: number;
274
+ /** Display type of the card: list, picture or none. none renders no card. */
219
275
  listType?: UploadListType;
276
+ /** Whether the card is disabled. A disabled card shows no remove, retry or replace button. */
220
277
  disabled?: boolean;
221
278
  /** The file's own `showRetry` wins */
222
279
  showRetry?: boolean;
223
280
  /** The file's own `showReplace` wins */
224
281
  showReplace?: boolean;
282
+ /** Whether to show picture information. Only applies in picture mode. */
225
283
  showPicInfo?: boolean;
284
+ /** Whether a truncated file name shows a tooltip, or the tooltip type and the props passed to it. */
226
285
  showTooltip?: boolean | ShowTooltip;
286
+ /** Width of the picture in picture mode. */
227
287
  picWidth?: string | number;
288
+ /** Height of the picture in picture mode. */
228
289
  picHeight?: string | number;
229
290
  /** Wins over `file.validateMessage` */
230
291
  validateMessage?: string;
231
292
  /** While present the card is clickable and gets a preview button */
232
293
  onPreviewClick?: () => void;
294
+ /** Called when remove is clicked. */
233
295
  onRemove?: () => void;
296
+ /** Called when retry is clicked. */
234
297
  onRetry?: () => void;
298
+ /** Called when replace is clicked. */
235
299
  onReplace?: () => void;
236
300
  }
@@ -30,25 +30,39 @@ export interface UserGuideProps {
30
30
  style?: string;
31
31
  /** Bindable. Undefined lets the component keep it; a bound or function-bound value makes the guide follow it. */
32
32
  current?: number;
33
+ /** Text of the finish button on the last step. When empty, the text from the locale pack is used. */
33
34
  finishText?: string;
35
+ /** In modal mode the dialog is rendered into this DOM node. In popup mode body scrolling is not locked when it points to an element other than body. The popover card sits in the top layer and is not affected. */
34
36
  getPopupContainer?: () => HTMLElement;
37
+ /** Whether to show the mask. A step's own mask overrides it. */
35
38
  mask?: boolean;
39
+ /** Guide mode: popup for a bubble card, modal for a dialog. */
36
40
  mode?: 'popup' | 'modal';
37
41
  /** `onclick` runs before the built-in next or finish handling, which still runs. */
38
42
  nextButtonProps?: UserGuideButtonProps;
43
+ /** Position of the bubble card relative to the target element. A step's own position overrides it. */
39
44
  position?: Position;
45
+ /** Props of the previous button. onclick is called before the built-in handling; use the prevText snippet for the button text. */
40
46
  prevButtonProps?: UserGuideButtonProps;
47
+ /** Whether to show the previous button. It is never shown on the first step. */
41
48
  showPrevButton?: boolean;
49
+ /** Whether to show the skip button. It is never shown on the last step. */
42
50
  showSkipButton?: boolean;
51
+ /** Extra space in pixels around the highlighted area. A step's own spotlightPadding overrides it; 5 when neither is set. */
43
52
  spotlightPadding?: number;
53
+ /** Data of the guide steps. A title or description is a string or a snippet, a cover is a snippet; a snippet receives `{ item, index }`. */
44
54
  steps?: UserGuideStepItem[];
55
+ /** Theme of the popup mode. A step's own theme overrides it. */
45
56
  theme?: 'default' | 'primary';
46
57
  /** Bindable. Skip, Escape and finish write `false`. */
47
58
  visible?: boolean;
59
+ /** The z-index of the mask in popup mode and of the dialog in modal mode. The popover card sits in the top layer, always above the mask. */
48
60
  zIndex?: number;
49
61
  /** The new step index, after `current` was written. */
50
62
  onChange?: (current: number) => void;
63
+ /** Called with the new index when the next button is clicked. The last step calls onFinish instead. */
51
64
  onNext?: (current: number) => void;
65
+ /** Called with the new index when the previous button is clicked. */
52
66
  onPrev?: (current: number) => void;
53
67
  /** Skip button and Escape, after `visible` was written. */
54
68
  onSkip?: () => void;
@@ -56,6 +70,7 @@ export interface UserGuideProps {
56
70
  onFinish?: () => void;
57
71
  /** Text of the next button except on the last step, which shows `finishText`. */
58
72
  nextText?: Snippet;
73
+ /** Snippet for the text of the previous button. Without it the text from the locale pack is used. */
59
74
  prevText?: Snippet;
60
75
  }
61
76
  export type { UserGuideBaseState as UserGuideState } from '@fibrae/semi-foundation/components/user-guide/foundation';
@@ -8,10 +8,15 @@ export interface VideoPlayerOption<T> {
8
8
  }
9
9
  export type VideoPlayerMarker = Marker;
10
10
  export interface VideoPlayerProps extends HTMLAttributes<HTMLDivElement> {
11
+ /** Whether to play automatically. */
11
12
  autoPlay?: boolean;
13
+ /** Captions source URL; the captions are shown by default once set. */
12
14
  captionsSrc?: string;
15
+ /** Whether clicking the video toggles playback. */
13
16
  clickToPlay?: boolean;
17
+ /** Controls shown in the control bar, all by default. A control also needs the prop it depends on to show. */
14
18
  controlsList?: VideoControl[];
19
+ /** CORS setting of the video element: anonymous or use-credentials; an empty string means anonymous. */
15
20
  crossOrigin?: '' | 'anonymous' | 'use-credentials';
16
21
  /** Read once, when the player mounts */
17
22
  defaultPlaybackRate?: number;
@@ -19,28 +24,45 @@ export interface VideoPlayerProps extends HTMLAttributes<HTMLDivElement> {
19
24
  defaultQuality?: string;
20
25
  /** Read once, when the player mounts */
21
26
  defaultRoute?: string;
27
+ /** Player height; a number is in pixels, a string is used as is. */
22
28
  height?: number | string;
29
+ /** Whether to loop playback. */
23
30
  loop?: boolean;
31
+ /** Chapter markers, each with a start time in seconds and a title. */
24
32
  markers?: VideoPlayerMarker[];
25
33
  /** Read once, when the player mounts */
26
34
  muted?: boolean;
27
35
  /** Called by the next button, which shows only when this is set and `controlsList` includes `next` */
28
36
  onNext?: () => void;
37
+ /** Called when playback pauses. */
29
38
  onPause?: () => void;
39
+ /** Called when playback starts. */
30
40
  onPlay?: () => void;
41
+ /** Called when the quality changes, with the selected quality value. */
31
42
  onQualityChange?: (quality: string) => void;
43
+ /** Called when the playback rate changes, with the selected rate. */
32
44
  onRateChange?: (rate: number) => void;
45
+ /** Called when the route changes, with the selected route value. */
33
46
  onRouteChange?: (route: string) => void;
47
+ /** Called when the user drags the volume slider or toggles mute, with the new volume (0 when muted); not called on initialization. */
34
48
  onVolumeChange?: (volume: number) => void;
49
+ /** Playback rate options, by default 2.0, 1.5, 1.25, 1.0 and 0.75. */
35
50
  playbackRateList?: VideoPlayerOption<number>[];
51
+ /** Poster image URL. */
36
52
  poster?: string;
53
+ /** Quality options; the quality control shows only when this is non-empty. */
37
54
  qualityList?: VideoPlayerOption<string>[];
55
+ /** Route options; the route control shows only when this is non-empty. */
38
56
  routeList?: VideoPlayerOption<string>[];
57
+ /** Seconds a fast forward or rewind moves. */
39
58
  seekTime?: number;
59
+ /** Video URL. Without it a missing-resource message shows; removing it keeps the previous source on the video element. */
40
60
  src?: string;
61
+ /** Theme, affecting only the background color: dark or light. */
41
62
  theme?: VideoPlayerTheme;
42
63
  /** Read once, when the player mounts */
43
64
  volume?: number;
65
+ /** Player width; a number is in pixels, a string is used as is. */
44
66
  width?: number | string;
45
67
  }
46
68
  export interface VideoProgressProps {