@daisu-ui/ui 0.0.0-stage → 0.1.0-beta.3

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 (401) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/LICENSE +21 -0
  3. package/README.md +93 -2
  4. package/THIRD_PARTY_NOTICES.md +19 -0
  5. package/dist/ActionSheet.d.ts +45 -0
  6. package/dist/ActionSheet.jsx +37 -0
  7. package/dist/AnchoredBubble.d.ts +36 -0
  8. package/dist/AnchoredBubble.jsx +120 -0
  9. package/dist/Avatar.d.ts +35 -0
  10. package/dist/Avatar.jsx +29 -0
  11. package/dist/Backtop.d.ts +22 -0
  12. package/dist/Backtop.jsx +18 -0
  13. package/dist/Badge.d.ts +19 -0
  14. package/dist/Badge.jsx +11 -0
  15. package/dist/BarCode.d.ts +20 -0
  16. package/dist/BarCode.jsx +38 -0
  17. package/dist/Button.d.ts +21 -0
  18. package/dist/Button.jsx +19 -0
  19. package/dist/Calendar.d.ts +90 -0
  20. package/dist/Calendar.jsx +164 -0
  21. package/dist/CalendarView.d.ts +51 -0
  22. package/dist/CalendarView.jsx +136 -0
  23. package/dist/Card.d.ts +21 -0
  24. package/dist/Card.jsx +21 -0
  25. package/dist/Cascader.d.ts +75 -0
  26. package/dist/Cascader.jsx +212 -0
  27. package/dist/Cell.d.ts +34 -0
  28. package/dist/Cell.jsx +37 -0
  29. package/dist/Checkbox.d.ts +50 -0
  30. package/dist/Checkbox.jsx +74 -0
  31. package/dist/Circle.d.ts +19 -0
  32. package/dist/Circle.jsx +35 -0
  33. package/dist/Collapse.d.ts +31 -0
  34. package/dist/Collapse.jsx +61 -0
  35. package/dist/ConfigProvider.d.ts +15 -0
  36. package/dist/ConfigProvider.jsx +20 -0
  37. package/dist/CountDown.d.ts +20 -0
  38. package/dist/CountDown.jsx +15 -0
  39. package/dist/CountTo.d.ts +28 -0
  40. package/dist/CountTo.jsx +27 -0
  41. package/dist/Curtain.d.ts +29 -0
  42. package/dist/Curtain.jsx +51 -0
  43. package/dist/DatetimePicker.d.ts +46 -0
  44. package/dist/DatetimePicker.jsx +138 -0
  45. package/dist/DatetimePickerView.d.ts +38 -0
  46. package/dist/DatetimePickerView.jsx +36 -0
  47. package/dist/Dialog.d.ts +64 -0
  48. package/dist/Dialog.jsx +105 -0
  49. package/dist/Divider.d.ts +16 -0
  50. package/dist/Divider.jsx +9 -0
  51. package/dist/DropMenu.d.ts +55 -0
  52. package/dist/DropMenu.jsx +210 -0
  53. package/dist/Empty.d.ts +14 -0
  54. package/dist/Empty.jsx +14 -0
  55. package/dist/EmptyState.d.ts +6 -0
  56. package/dist/EmptyState.jsx +9 -0
  57. package/dist/Fab.d.ts +30 -0
  58. package/dist/Fab.jsx +127 -0
  59. package/dist/FloatingPanel.d.ts +21 -0
  60. package/dist/FloatingPanel.jsx +102 -0
  61. package/dist/Form.d.ts +63 -0
  62. package/dist/Form.jsx +108 -0
  63. package/dist/FormFieldRow.d.ts +56 -0
  64. package/dist/FormFieldRow.jsx +63 -0
  65. package/dist/Gap.d.ts +10 -0
  66. package/dist/Gap.jsx +14 -0
  67. package/dist/Grid.d.ts +47 -0
  68. package/dist/Grid.jsx +31 -0
  69. package/dist/Icon.d.ts +11 -0
  70. package/dist/Icon.jsx +12 -0
  71. package/dist/ImagePreview.d.ts +62 -0
  72. package/dist/ImagePreview.jsx +78 -0
  73. package/dist/Img.d.ts +28 -0
  74. package/dist/Img.jsx +59 -0
  75. package/dist/ImgCropper.d.ts +74 -0
  76. package/dist/ImgCropper.jsx +114 -0
  77. package/dist/IndexBar.d.ts +36 -0
  78. package/dist/IndexBar.jsx +149 -0
  79. package/dist/Input.d.ts +11 -0
  80. package/dist/Input.jsx +3 -0
  81. package/dist/InputNumber.d.ts +32 -0
  82. package/dist/InputNumber.jsx +165 -0
  83. package/dist/Keyboard.d.ts +37 -0
  84. package/dist/Keyboard.jsx +130 -0
  85. package/dist/Layout.d.ts +31 -0
  86. package/dist/Layout.jsx +14 -0
  87. package/dist/Loading.d.ts +18 -0
  88. package/dist/Loading.jsx +15 -0
  89. package/dist/Loadmore.d.ts +18 -0
  90. package/dist/Loadmore.jsx +16 -0
  91. package/dist/Navbar.d.ts +35 -0
  92. package/dist/Navbar.jsx +50 -0
  93. package/dist/NoticeBar.d.ts +30 -0
  94. package/dist/NoticeBar.jsx +86 -0
  95. package/dist/Notify.d.ts +34 -0
  96. package/dist/Notify.jsx +52 -0
  97. package/dist/NumberStepper.d.ts +11 -0
  98. package/dist/NumberStepper.jsx +41 -0
  99. package/dist/Overlay.d.ts +16 -0
  100. package/dist/Overlay.jsx +12 -0
  101. package/dist/PagedList.d.ts +13 -0
  102. package/dist/PagedList.jsx +36 -0
  103. package/dist/Pagination.d.ts +29 -0
  104. package/dist/Pagination.jsx +33 -0
  105. package/dist/PasswordInput.d.ts +16 -0
  106. package/dist/PasswordInput.jsx +20 -0
  107. package/dist/Picker.d.ts +61 -0
  108. package/dist/Picker.jsx +80 -0
  109. package/dist/PickerView.d.ts +43 -0
  110. package/dist/PickerView.jsx +142 -0
  111. package/dist/Popover.d.ts +23 -0
  112. package/dist/Popover.jsx +35 -0
  113. package/dist/Popup.d.ts +30 -0
  114. package/dist/Popup.jsx +32 -0
  115. package/dist/Progress.d.ts +17 -0
  116. package/dist/Progress.jsx +45 -0
  117. package/dist/QrCode.d.ts +46 -0
  118. package/dist/QrCode.jsx +67 -0
  119. package/dist/Radio.d.ts +21 -0
  120. package/dist/Radio.jsx +34 -0
  121. package/dist/Rate.d.ts +25 -0
  122. package/dist/Rate.jsx +39 -0
  123. package/dist/Resize.d.ts +17 -0
  124. package/dist/Resize.jsx +17 -0
  125. package/dist/RichText.d.ts +133 -0
  126. package/dist/RichText.jsx +288 -0
  127. package/dist/RootPortal.d.ts +11 -0
  128. package/dist/RootPortal.jsx +19 -0
  129. package/dist/Search.d.ts +39 -0
  130. package/dist/Search.jsx +94 -0
  131. package/dist/Segmented.d.ts +18 -0
  132. package/dist/Segmented.jsx +35 -0
  133. package/dist/SelectPicker.d.ts +54 -0
  134. package/dist/SelectPicker.jsx +136 -0
  135. package/dist/Sidebar.d.ts +34 -0
  136. package/dist/Sidebar.jsx +43 -0
  137. package/dist/Signature.d.ts +46 -0
  138. package/dist/Signature.jsx +203 -0
  139. package/dist/Skeleton.d.ts +27 -0
  140. package/dist/Skeleton.jsx +29 -0
  141. package/dist/SlideVerify.d.ts +27 -0
  142. package/dist/SlideVerify.jsx +138 -0
  143. package/dist/Slider.d.ts +21 -0
  144. package/dist/Slider.jsx +131 -0
  145. package/dist/SortButton.d.ts +16 -0
  146. package/dist/SortButton.jsx +19 -0
  147. package/dist/Steps.d.ts +23 -0
  148. package/dist/Steps.jsx +25 -0
  149. package/dist/Sticky.d.ts +17 -0
  150. package/dist/Sticky.jsx +69 -0
  151. package/dist/SwipeAction.d.ts +27 -0
  152. package/dist/SwipeAction.jsx +187 -0
  153. package/dist/Swiper.d.ts +54 -0
  154. package/dist/Swiper.jsx +94 -0
  155. package/dist/SwiperNav.d.ts +18 -0
  156. package/dist/SwiperNav.jsx +10 -0
  157. package/dist/Switch.d.ts +31 -0
  158. package/dist/Switch.jsx +46 -0
  159. package/dist/SyncedInput.d.ts +12 -0
  160. package/dist/SyncedInput.jsx +18 -0
  161. package/dist/SyncedTextarea.d.ts +11 -0
  162. package/dist/SyncedTextarea.jsx +18 -0
  163. package/dist/Tabbar.d.ts +37 -0
  164. package/dist/Tabbar.jsx +46 -0
  165. package/dist/Table.d.ts +51 -0
  166. package/dist/Table.jsx +125 -0
  167. package/dist/Tabs.d.ts +65 -0
  168. package/dist/Tabs.jsx +132 -0
  169. package/dist/Tag.d.ts +33 -0
  170. package/dist/Tag.jsx +63 -0
  171. package/dist/Text.d.ts +19 -0
  172. package/dist/Text.jsx +7 -0
  173. package/dist/TextField.d.ts +89 -0
  174. package/dist/TextField.jsx +149 -0
  175. package/dist/Textarea.d.ts +22 -0
  176. package/dist/Textarea.jsx +3 -0
  177. package/dist/Toast.d.ts +36 -0
  178. package/dist/Toast.jsx +30 -0
  179. package/dist/Tooltip.d.ts +8 -0
  180. package/dist/Tooltip.jsx +5 -0
  181. package/dist/Tour.d.ts +85 -0
  182. package/dist/Tour.jsx +150 -0
  183. package/dist/Transition.d.ts +32 -0
  184. package/dist/Transition.jsx +43 -0
  185. package/dist/Upload.d.ts +64 -0
  186. package/dist/Upload.jsx +163 -0
  187. package/dist/VideoPreview.d.ts +47 -0
  188. package/dist/VideoPreview.jsx +59 -0
  189. package/dist/Watermark.d.ts +36 -0
  190. package/dist/Watermark.jsx +18 -0
  191. package/dist/action-sheet.css +19 -0
  192. package/dist/avatar.css +23 -0
  193. package/dist/avatarModel.d.ts +8 -0
  194. package/dist/avatarModel.js +17 -0
  195. package/dist/backtop.css +6 -0
  196. package/dist/badge.css +15 -0
  197. package/dist/badgeModel.d.ts +2 -0
  198. package/dist/badgeModel.js +18 -0
  199. package/dist/bar-code.css +5 -0
  200. package/dist/barCodeModel.d.ts +80 -0
  201. package/dist/barCodeModel.js +99 -0
  202. package/dist/bubble.css +14 -0
  203. package/dist/bubblePosition.d.ts +19 -0
  204. package/dist/bubblePosition.js +41 -0
  205. package/dist/button.css +56 -0
  206. package/dist/calendar.css +56 -0
  207. package/dist/calendarModel.d.ts +62 -0
  208. package/dist/calendarModel.js +141 -0
  209. package/dist/card.css +8 -0
  210. package/dist/cascader.css +16 -0
  211. package/dist/cascaderModel.d.ts +21 -0
  212. package/dist/cascaderModel.js +32 -0
  213. package/dist/cell.css +41 -0
  214. package/dist/choice.css +27 -0
  215. package/dist/choice.d.ts +28 -0
  216. package/dist/choice.jsx +16 -0
  217. package/dist/circle.css +4 -0
  218. package/dist/circleModel.d.ts +15 -0
  219. package/dist/circleModel.js +31 -0
  220. package/dist/config-provider.css +2 -0
  221. package/dist/configContext.d.ts +23 -0
  222. package/dist/configContext.js +24 -0
  223. package/dist/configTheme.d.ts +3 -0
  224. package/dist/configTheme.js +22 -0
  225. package/dist/count-down.css +2 -0
  226. package/dist/count-to.css +8 -0
  227. package/dist/countDownModel.d.ts +11 -0
  228. package/dist/countDownModel.js +7 -0
  229. package/dist/countToModel.d.ts +3 -0
  230. package/dist/countToModel.js +3 -0
  231. package/dist/curtain.css +10 -0
  232. package/dist/datetime-picker.css +11 -0
  233. package/dist/datetimePickerModel.d.ts +47 -0
  234. package/dist/datetimePickerModel.js +128 -0
  235. package/dist/dialog.css +23 -0
  236. package/dist/divider.css +14 -0
  237. package/dist/drop-menu.css +28 -0
  238. package/dist/empty.css +7 -0
  239. package/dist/fab.css +23 -0
  240. package/dist/fabModel.d.ts +26 -0
  241. package/dist/fabModel.js +16 -0
  242. package/dist/floating-panel.css +6 -0
  243. package/dist/floatingPanelModel.d.ts +3 -0
  244. package/dist/floatingPanelModel.js +10 -0
  245. package/dist/form.css +10 -0
  246. package/dist/formContext.d.ts +7 -0
  247. package/dist/formContext.js +2 -0
  248. package/dist/formModel.d.ts +38 -0
  249. package/dist/formModel.js +16 -0
  250. package/dist/gap.css +1 -0
  251. package/dist/grid.css +17 -0
  252. package/dist/icon.css +8 -0
  253. package/dist/icons/LICENSE.tabler +21 -0
  254. package/dist/icons/paths.d.ts +309 -0
  255. package/dist/icons/paths.js +310 -0
  256. package/dist/icons/render.d.ts +2 -0
  257. package/dist/icons/render.js +5 -0
  258. package/dist/image-preview.css +8 -0
  259. package/dist/img-cropper.css +1 -0
  260. package/dist/img.css +5 -0
  261. package/dist/imgCropperModel.d.ts +55 -0
  262. package/dist/imgCropperModel.js +41 -0
  263. package/dist/imgModel.d.ts +13 -0
  264. package/dist/imgModel.js +22 -0
  265. package/dist/index-bar.css +12 -0
  266. package/dist/index.d.ts +200 -0
  267. package/dist/index.js +99 -0
  268. package/dist/indexBarModel.d.ts +19 -0
  269. package/dist/indexBarModel.js +37 -0
  270. package/dist/input-number.css +24 -0
  271. package/dist/inputNumberModel.d.ts +23 -0
  272. package/dist/inputNumberModel.js +40 -0
  273. package/dist/keyboard.css +26 -0
  274. package/dist/keyboardModel.d.ts +11 -0
  275. package/dist/keyboardModel.js +34 -0
  276. package/dist/layout.css +2 -0
  277. package/dist/legacy/RadioGroup.d.ts +13 -0
  278. package/dist/legacy/RadioGroup.jsx +13 -0
  279. package/dist/legacy-controls.css +87 -0
  280. package/dist/loading.css +31 -0
  281. package/dist/loadingModel.d.ts +2 -0
  282. package/dist/loadingModel.js +21 -0
  283. package/dist/loadmore.css +5 -0
  284. package/dist/navbar.css +16 -0
  285. package/dist/notice-bar.css +19 -0
  286. package/dist/notify.css +14 -0
  287. package/dist/overlay.css +2 -0
  288. package/dist/pagination.css +12 -0
  289. package/dist/paginationModel.d.ts +6 -0
  290. package/dist/paginationModel.js +7 -0
  291. package/dist/password-input.css +14 -0
  292. package/dist/passwordInputModel.d.ts +6 -0
  293. package/dist/passwordInputModel.js +11 -0
  294. package/dist/picker.css +42 -0
  295. package/dist/pickerModel.d.ts +32 -0
  296. package/dist/pickerModel.js +49 -0
  297. package/dist/popover.css +5 -0
  298. package/dist/popup.css +17 -0
  299. package/dist/progress.css +16 -0
  300. package/dist/progressModel.d.ts +12 -0
  301. package/dist/progressModel.js +19 -0
  302. package/dist/qr-code.css +4 -0
  303. package/dist/qrCodeModel.d.ts +36 -0
  304. package/dist/qrCodeModel.js +61 -0
  305. package/dist/rate.css +20 -0
  306. package/dist/rateModel.d.ts +4 -0
  307. package/dist/rateModel.js +38 -0
  308. package/dist/resize.css +2 -0
  309. package/dist/rich-text.css +19 -0
  310. package/dist/richTextMedia.d.ts +28 -0
  311. package/dist/richTextMedia.js +3 -0
  312. package/dist/richTextModel.d.ts +52 -0
  313. package/dist/richTextModel.js +195 -0
  314. package/dist/root-portal.css +1 -0
  315. package/dist/router/RouterView.d.ts +21 -0
  316. package/dist/router/RouterView.jsx +120 -0
  317. package/dist/router/core.d.ts +85 -0
  318. package/dist/router/core.js +255 -0
  319. package/dist/router/hooks.d.ts +17 -0
  320. package/dist/router/hooks.jsx +71 -0
  321. package/dist/router/index.d.ts +5 -0
  322. package/dist/router/index.js +3 -0
  323. package/dist/router/location.d.ts +8 -0
  324. package/dist/router/location.js +46 -0
  325. package/dist/router/router.css +7 -0
  326. package/dist/router/runtime.d.ts +1 -0
  327. package/dist/router/runtime.js +25 -0
  328. package/dist/search.css +23 -0
  329. package/dist/segmented.css +19 -0
  330. package/dist/segmentedModel.d.ts +10 -0
  331. package/dist/segmentedModel.js +8 -0
  332. package/dist/sidebar.css +18 -0
  333. package/dist/sidebarModel.d.ts +8 -0
  334. package/dist/sidebarModel.js +27 -0
  335. package/dist/signature.css +5 -0
  336. package/dist/signatureModel.d.ts +23 -0
  337. package/dist/signatureModel.js +80 -0
  338. package/dist/skeleton.css +16 -0
  339. package/dist/slide-verify.css +7 -0
  340. package/dist/slider.css +49 -0
  341. package/dist/sliderModel.d.ts +10 -0
  342. package/dist/sliderModel.js +27 -0
  343. package/dist/sort-button.css +12 -0
  344. package/dist/steps.css +35 -0
  345. package/dist/sticky.css +7 -0
  346. package/dist/styles.css +136 -0
  347. package/dist/styles.d.ts +1 -0
  348. package/dist/swipe-action.css +6 -0
  349. package/dist/swiper.css +27 -0
  350. package/dist/swiperAnimation.d.ts +3 -0
  351. package/dist/swiperAnimation.js +6 -0
  352. package/dist/swiperModel.d.ts +2 -0
  353. package/dist/swiperModel.js +3 -0
  354. package/dist/switch.css +12 -0
  355. package/dist/tabbar.css +17 -0
  356. package/dist/tabbarModel.d.ts +8 -0
  357. package/dist/tabbarModel.js +27 -0
  358. package/dist/table.css +21 -0
  359. package/dist/tableModel.d.ts +10 -0
  360. package/dist/tableModel.js +17 -0
  361. package/dist/tabs.css +31 -0
  362. package/dist/tabsModel.d.ts +7 -0
  363. package/dist/tabsModel.js +14 -0
  364. package/dist/tag.css +66 -0
  365. package/dist/text-field.css +15 -0
  366. package/dist/text.css +7 -0
  367. package/dist/textModel.d.ts +3 -0
  368. package/dist/textModel.js +24 -0
  369. package/dist/toast.css +13 -0
  370. package/dist/tokens.d.ts +34 -0
  371. package/dist/tokens.js +10 -0
  372. package/dist/tour.css +8 -0
  373. package/dist/transition.css +12 -0
  374. package/dist/upload.css +11 -0
  375. package/dist/useCountDown.d.ts +14 -0
  376. package/dist/useCountDown.js +73 -0
  377. package/dist/useDialog.d.ts +9 -0
  378. package/dist/useDialog.js +33 -0
  379. package/dist/useImagePreview.d.ts +7 -0
  380. package/dist/useImagePreview.js +17 -0
  381. package/dist/useNotify.d.ts +9 -0
  382. package/dist/useNotify.js +26 -0
  383. package/dist/usePressState.d.ts +6 -0
  384. package/dist/usePressState.js +17 -0
  385. package/dist/useToast.d.ts +11 -0
  386. package/dist/useToast.js +23 -0
  387. package/dist/useVideoPreview.d.ts +7 -0
  388. package/dist/useVideoPreview.js +17 -0
  389. package/dist/utils.d.ts +4 -0
  390. package/dist/utils.js +4 -0
  391. package/dist/video-preview.css +7 -0
  392. package/dist/watermark.css +6 -0
  393. package/dist/web/imgCropperElement.d.ts +2 -0
  394. package/dist/web/imgCropperElement.js +309 -0
  395. package/dist/web/index.d.ts +6 -0
  396. package/dist/web/index.js +6 -0
  397. package/dist/web/qrCodeExportElement.d.ts +4 -0
  398. package/dist/web/qrCodeExportElement.js +70 -0
  399. package/dist/web/richTextMediaElement.d.ts +2 -0
  400. package/dist/web/richTextMediaElement.js +276 -0
  401. package/package.json +98 -4
package/dist/Popup.jsx ADDED
@@ -0,0 +1,32 @@
1
+ import { Overlay } from "./Overlay.jsx";
2
+ import { Transition } from "./Transition.jsx";
3
+ import { RootPortal } from "./RootPortal.jsx";
4
+ import { Icon } from "./Icon.jsx";
5
+ const motions = { center: ['fade', 'zoom-in'], top: 'slide-down', right: 'slide-right', bottom: 'slide-up', left: 'slide-left' };
6
+ export function Popup({ show = false, onChange, onClose, onClickModal, position = 'center', transition, duration = 300, closable = false, closeOnClickModal = true, modal = true, modalStyle, zIndex = 10, lazyRender = true, lockScroll = true, rootPortal = false, round = false, safeAreaInsetBottom = false, safeAreaBottom = 0, className = '', style, children, ...lifecycle }) {
7
+ const close = (reason) => {
8
+ 'background only';
9
+ if (!show)
10
+ return;
11
+ onChange?.(false);
12
+ onClose?.(reason);
13
+ };
14
+ const layer = <>
15
+ {modal ? <Overlay show={show} duration={duration} lockScroll={lockScroll} zIndex={zIndex} style={modalStyle} onTap={() => {
16
+ 'background only';
17
+ onClickModal?.();
18
+ if (closeOnClickModal)
19
+ close('modal');
20
+ }}/> : null}
21
+ <view className={`ui-popup-anchor ui-popup-anchor-${position}`} style={{ zIndex: zIndex + 1 }}>
22
+ <Transition {...lifecycle} show={show} name={transition ?? motions[position]} duration={duration} lazyRender={lazyRender} destroy={false} interactiveDuringLeave className={`ui-popup ui-popup-${position} ${round ? 'ui-popup-round' : ''} ${className}`} style={style}>
23
+ <view className="ui-popup-body" event-through={false} consume-slide-event={lockScroll ? [[-180, 180]] : undefined} catchtouchmove={lockScroll ? () => { } : undefined} catchtap={() => { }}>
24
+ {children}
25
+ {safeAreaInsetBottom && position === 'bottom' ? <view className="ui-popup-safe-area" style={{ height: `${Math.max(0, Number.isFinite(safeAreaBottom) ? safeAreaBottom : 0)}px` }}/> : null}
26
+ {closable ? <view className="ui-popup-close" catchtap={() => close('close')} accessibility-element accessibility-traits="button" accessibility-label="关闭弹出层"><Icon name="close" size={24}/></view> : null}
27
+ </view>
28
+ </Transition>
29
+ </view>
30
+ </>;
31
+ return rootPortal ? <RootPortal>{layer}</RootPortal> : layer;
32
+ }
@@ -0,0 +1,17 @@
1
+ import type { CSSProperties } from '@lynx-js/types';
2
+ import type { ProgressColor } from './progressModel.js';
3
+ export type PercentPosition = {
4
+ type?: 'inner' | 'outer';
5
+ align?: 'left' | 'center' | 'right';
6
+ };
7
+ export type ProgressProps = {
8
+ percentage?: number;
9
+ hideText?: boolean;
10
+ color?: ProgressColor;
11
+ status?: 'success' | 'danger' | 'warning';
12
+ duration?: number;
13
+ percentPosition?: PercentPosition;
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ };
17
+ export declare function Progress({ percentage, hideText, color, status, duration, percentPosition, className, style }: ProgressProps): import("@lynx-js/react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { useEffect, useRef, useState } from '@lynx-js/react';
2
+ import { Icon } from "./Icon.jsx";
3
+ import { progressPercentage, progressSegments, progressStops } from './progressModel.js';
4
+ export function Progress({ percentage = 0, hideText = false, color, status, duration = 30, percentPosition, className = '', style }) {
5
+ const target = progressPercentage(percentage), milliseconds = Number.isFinite(duration) ? Math.max(0, duration) : 30;
6
+ const [bar, setBar] = useState({ value: 0, duration: 0 });
7
+ const [labelWidth, setLabelWidth] = useState(36);
8
+ const motion = useRef({ from: 0, to: 0, started: 0, duration: 0 });
9
+ // A stable key permits caller-owned arrays without restarting on unrelated renders.
10
+ const stops = progressStops(color), stopsKey = JSON.stringify(stops);
11
+ useEffect(() => {
12
+ const previous = motion.current, elapsed = Date.now() - previous.started;
13
+ const current = previous.duration > 0 ? previous.from + (previous.to - previous.from) * Math.min(1, Math.max(0, elapsed / previous.duration)) : previous.to;
14
+ const segments = progressSegments(current, target, stops);
15
+ let timer, cancelled = false, from = current;
16
+ setBar(old => ({ ...old, value: current, duration: 0 }));
17
+ motion.current = { from: current, to: current, started: Date.now(), duration: 0 };
18
+ const advance = (index) => {
19
+ if (cancelled)
20
+ return;
21
+ const segment = segments[index];
22
+ if (!segment)
23
+ return;
24
+ const time = Math.abs(segment.value - from) * milliseconds;
25
+ motion.current = { from, to: segment.value, started: Date.now(), duration: time };
26
+ setBar({ value: segment.value, duration: time, color: segment.color });
27
+ from = segment.value;
28
+ if (index + 1 < segments.length)
29
+ timer = setTimeout(() => advance(index + 1), time);
30
+ };
31
+ timer = setTimeout(() => advance(0), 32);
32
+ return () => { cancelled = true; clearTimeout(timer); };
33
+ }, [target, milliseconds, stopsKey]);
34
+ const inner = percentPosition?.type === 'inner', align = percentPosition?.align ?? 'right';
35
+ const icon = status === 'success' ? 'check-circle-fill' : status === 'danger' ? 'close-circle-fill' : 'exclamation-circle-fill';
36
+ const statusColor = status ? `var(--cso-ui-${status})` : 'var(--cso-ui-primary)';
37
+ // SVG glyphs use separate theme variants rather than SVG CSS-variable fills.
38
+ const iconColors = status === 'success' ? ['#12b886', '#20c997'] : status === 'warning' ? ['#f57f00', '#ffa94d'] : ['#f14646', '#ff6b6b'];
39
+ const label = hideText ? status ? <view className={`ui-progress-icon ${inner ? 'ui-progress-icon-inner' : ''}`}><Icon name={icon} size={18} color={inner ? '#fff' : typeof color === 'string' ? color : iconColors[0]} className="ui-progress-light-icon"/><Icon name={icon} size={18} color={inner ? '#fff' : typeof color === 'string' ? color : iconColors[1]} className="ui-progress-dark-icon"/></view> : null : <text className="ui-progress-label" bindlayoutchange={event => { if (inner && Number.isFinite(event.detail.width) && event.detail.width > 0)
40
+ setLabelWidth(event.detail.width); }}>{`${target}%`}</text>;
41
+ return <view className={`ui-progress ${inner ? 'ui-progress-inner' : ''} ${target === 0 ? 'ui-progress-zero' : ''} ${className}`} style={style} accessibility-element accessibility-label={`进度 ${target}%${status ? ` ${status}` : ''}`}>
42
+ <view className="ui-progress-track"><view className={`ui-progress-fill ui-progress-align-${align}`} style={{ width: `${bar.value}%`, transitionDuration: `${bar.duration}ms`, backgroundColor: inner && target === 0 ? undefined : bar.color ?? statusColor, minWidth: inner && label ? hideText ? '34px' : `${labelWidth}px` : undefined }}>{inner ? label : null}</view></view>
43
+ {!inner ? label : null}
44
+ </view>;
45
+ }
@@ -0,0 +1,46 @@
1
+ import type { CSSProperties, NodesRef, StandardProps } from '@lynx-js/types';
2
+ import type { QrCodeOptions } from './qrCodeModel.js';
3
+ export type QrCodeProps = QrCodeOptions & {
4
+ exportMode?: 'svg' | 'browser';
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ onClick?: () => void;
8
+ onError?: (error: Error) => void;
9
+ };
10
+ export type QrCodeRef = {
11
+ exportImage: () => Promise<string>;
12
+ getSvg: () => string;
13
+ };
14
+ type ExportSignal = {
15
+ id: number;
16
+ url?: string;
17
+ error?: string;
18
+ };
19
+ type ExportElementProps = StandardProps & {
20
+ ref?: {
21
+ current: NodesRef | null;
22
+ };
23
+ bindqrexport?: (event: {
24
+ detail: ExportSignal;
25
+ }) => void;
26
+ };
27
+ declare module '@lynx-js/types' {
28
+ interface IntrinsicElements {
29
+ 'daisu-qr-export': ExportElementProps;
30
+ }
31
+ }
32
+ declare global {
33
+ namespace JSX {
34
+ interface IntrinsicElements {
35
+ 'daisu-qr-export': ExportElementProps;
36
+ }
37
+ }
38
+ }
39
+ export declare const QrCode: (props: QrCodeOptions & {
40
+ exportMode?: "svg" | "browser";
41
+ className?: string;
42
+ style?: CSSProperties;
43
+ onClick?: () => void;
44
+ onError?: (error: Error) => void;
45
+ } & import("react").RefAttributes<QrCodeRef>) => React.ReactElement | null;
46
+ export {};
@@ -0,0 +1,67 @@
1
+ import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from '@lynx-js/react';
2
+ import { qrCodeLayout, qrCodeMatrix } from './qrCodeModel.js';
3
+ export const QrCode = forwardRef(function QrCode({ exportMode = 'svg', className = '', style, onClick, onError, ...options }, ref) {
4
+ const exporter = useRef(null), sequence = useRef(0), pending = useRef(new Map());
5
+ const { text = '', correctLevel = 'H' } = options;
6
+ const encoded = useMemo(() => { try {
7
+ return { matrix: qrCodeMatrix(text, correctLevel) };
8
+ }
9
+ catch (error) {
10
+ return { matrix: [], error: error instanceof Error ? error : new Error(String(error)) };
11
+ } }, [text, correctLevel]);
12
+ const key = JSON.stringify(options);
13
+ const result = useMemo(() => { try {
14
+ return { layout: qrCodeLayout(encoded.matrix, options), error: encoded.error };
15
+ }
16
+ catch (error) {
17
+ return { error: error instanceof Error ? error : new Error(String(error)) };
18
+ } }, [encoded, key]);
19
+ useEffect(() => { if (result.error)
20
+ onError?.(result.error); }, [result]);
21
+ useEffect(() => () => { for (const request of pending.current.values()) {
22
+ clearTimeout(request.timer);
23
+ request.reject(new Error('二维码导出已取消'));
24
+ } pending.current.clear(); }, [result, exportMode]);
25
+ useImperativeHandle(ref, () => ({ getSvg() {
26
+ 'background only';
27
+ if (result.error || !text)
28
+ throw result.error ?? new Error('QR content is empty');
29
+ return result.layout.svg;
30
+ }, async exportImage() {
31
+ 'background only';
32
+ if (result.error || !text)
33
+ throw result.error ?? new Error('QR content is empty');
34
+ if (exportMode === 'browser') {
35
+ if (!exporter.current)
36
+ throw new Error('浏览器二维码导出后端未就绪');
37
+ return new Promise((resolve, reject) => { const id = ++sequence.current; const timer = setTimeout(() => { pending.current.delete(id); reject(new Error('二维码导出超时,请检查浏览器组件注册')); }, 15000); pending.current.set(id, { resolve, reject, timer }); exporter.current.invoke({ method: 'exportImage', params: { id, svg: result.layout.svg, size: result.layout.options.size } }).exec(); });
38
+ }
39
+ if ([options.logo, options.backgroundImage].some(src => src && !src.startsWith('data:image/')))
40
+ throw new Error('包含外部图片的二维码请使用浏览器导出模式,或先将图片转为内嵌位图');
41
+ return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(result.layout.svg)}`;
42
+ } }), [result, text, exportMode]);
43
+ const layout = result.error ? undefined : result.layout, o = layout?.options, logo = layout?.logo;
44
+ return <view className={`ui-qr-code ${className}`} style={{ width: `${o?.size ?? 200}px`, height: `${o?.size ?? 200}px`, backgroundColor: o?.colorLight ?? '#fff', ...style }} bindtap={onClick} accessibility-element accessibility-label={text || '二维码'}>
45
+ {exportMode === 'browser' ? <daisu-qr-export ref={exporter} className="ui-qr-code-export" bindqrexport={({ detail: event }) => {
46
+ 'background only';
47
+ const request = pending.current.get(event.id);
48
+ if (!request)
49
+ return;
50
+ clearTimeout(request.timer);
51
+ pending.current.delete(event.id);
52
+ if (event.url)
53
+ request.resolve(event.url);
54
+ else
55
+ request.reject(new Error(event.error || '二维码导出失败'));
56
+ }}/> : null}
57
+ {o?.backgroundImage && text ? <image className="ui-qr-code-surface" src={o.backgroundImage} mode="scaleToFill" binderror={() => {
58
+ 'background only';
59
+ onError?.(new Error('QR background image failed'));
60
+ }}/> : null}
61
+ {layout ? <svg className="ui-qr-code-surface" content={layout.codeSvg}/> : null}
62
+ {o?.logo && text && logo ? <view className="ui-qr-code-logo" style={{ left: `${logo.x - 4}px`, top: `${logo.y - 4}px`, width: `${logo.width + 8}px`, height: `${logo.height + 8}px`, borderRadius: `${o.logoRadius}px`, backgroundColor: o.logoBackgroundColor, borderWidth: `${o.logoBorderWidth}px`, borderColor: o.logoBorderColor || 'transparent' }}><image src={o.logo} mode="scaleToFill" style={{ position: 'absolute', left: `${4 - o.logoBorderWidth}px`, top: `${4 - o.logoBorderWidth}px`, width: `${logo.width}px`, height: `${logo.height}px`, borderRadius: `${logo.radius}px` }} binderror={() => {
63
+ 'background only';
64
+ onError?.(new Error('QR logo failed'));
65
+ }}/></view> : null}
66
+ </view>;
67
+ });
@@ -0,0 +1,21 @@
1
+ import type { ChoiceStyle, ChoiceValue } from "./choice.jsx";
2
+ import type { RadioOption } from "./legacy/RadioGroup.jsx";
3
+ export type { RadioOption } from "./legacy/RadioGroup.jsx";
4
+ export type RadioProps = ChoiceStyle & {
5
+ value: ChoiceValue;
6
+ };
7
+ export type RadioGroupProps<T extends ChoiceValue = ChoiceValue> = ChoiceStyle & {
8
+ value?: T | null;
9
+ defaultValue?: T | null;
10
+ onChange?: (value: T | null) => void;
11
+ allowUncheck?: boolean;
12
+ options?: RadioOption[];
13
+ };
14
+ export declare function RadioGroup(props: {
15
+ value: string;
16
+ options: RadioOption[];
17
+ onChange: (value: string) => void;
18
+ disabled?: boolean;
19
+ }): import('@lynx-js/react').ReactNode;
20
+ export declare function RadioGroup<T extends ChoiceValue = ChoiceValue>(props: RadioGroupProps<T>): import('@lynx-js/react').ReactNode;
21
+ export declare function Radio(props: RadioProps): import("@lynx-js/react").JSX.Element;
package/dist/Radio.jsx ADDED
@@ -0,0 +1,34 @@
1
+ import { createContext, useContext, useRef, useState } from '@lynx-js/react';
2
+ import { Choice, choiceDefaults } from "./choice.jsx";
3
+ import { FormFieldContext } from './formContext.js';
4
+ import { RadioGroup as LegacyRadioGroup } from "./legacy/RadioGroup.jsx";
5
+ const Context = createContext(undefined);
6
+ export function RadioGroup(props) {
7
+ const { value, defaultValue, allowUncheck = false, onChange, options, children, className = '', style, direction = 'vertical' } = props;
8
+ const [inner, setInner] = useState(defaultValue), field = useContext(FormFieldContext), current = value === undefined ? inner : value;
9
+ const latest = useRef(current);
10
+ latest.current = current;
11
+ const select = (next) => {
12
+ 'background only';
13
+ const changed = Object.is(latest.current, next) ? allowUncheck ? null : next : next;
14
+ if (changed === latest.current)
15
+ return;
16
+ if (value === undefined) {
17
+ latest.current = changed;
18
+ setInner(changed);
19
+ }
20
+ onChange?.(changed);
21
+ };
22
+ // Existing business/Popover options API retains its original appearance and callback.
23
+ if (options)
24
+ return <LegacyRadioGroup value={String(value ?? '')} options={options} disabled={!!props.disabled || !!field?.disabled} onChange={next => onChange?.(next)}/>;
25
+ return <Context.Provider value={{ props: { ...props, disabled: props.disabled ?? field?.disabled }, value: current, select }}><view className={`ui-choice-group ui-choice-group-${direction} ${props.type === 'button' ? 'ui-choice-group-buttons' : ''} ${className}`} style={style}>{children}</view></Context.Provider>;
26
+ }
27
+ export function Radio(props) {
28
+ const group = useContext(Context), field = useContext(FormFieldContext);
29
+ const merged = { ...choiceDefaults(group?.props), ...Object.fromEntries(Object.entries(props).filter(([, v]) => v !== undefined && v !== null)) };
30
+ return <Choice {...merged} disabled={field?.disabled || merged.disabled} checked={Object.is(group?.value, props.value)} onTap={() => {
31
+ 'background only';
32
+ group?.select(props.value);
33
+ }}/>;
34
+ }
package/dist/Rate.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import type { CSSProperties } from '@lynx-js/types';
2
+ import type { IconName } from './icons/paths.js';
3
+ export type RateProps = {
4
+ value?: number | null;
5
+ defaultValue?: number;
6
+ onChange?: (event: {
7
+ value: number;
8
+ }) => void;
9
+ num?: number;
10
+ readonly?: boolean;
11
+ disabled?: boolean;
12
+ size?: number | string;
13
+ space?: number | string;
14
+ color?: string;
15
+ activeColor?: string | readonly string[];
16
+ disabledColor?: string;
17
+ icon?: IconName;
18
+ activeIcon?: IconName;
19
+ allowHalf?: boolean;
20
+ clearable?: boolean;
21
+ block?: boolean;
22
+ className?: string;
23
+ style?: CSSProperties;
24
+ };
25
+ export declare function Rate({ value, defaultValue, onChange, num, readonly, disabled: disabledProp, size, space, color, activeColor, disabledColor, icon, activeIcon, allowHalf, clearable, block, className, style }: RateProps): import("@lynx-js/react").JSX.Element;
package/dist/Rate.jsx ADDED
@@ -0,0 +1,39 @@
1
+ import { FormFieldContext } from './formContext.js';
2
+ import { useContext, useState } from '@lynx-js/react';
3
+ import { iconPaths } from './icons/paths.js';
4
+ import { loadingDimension } from './loadingModel.js';
5
+ import { nextRateValue, rateCount, rateScore, rateSvg } from './rateModel.js';
6
+ export function Rate({ value, defaultValue = 0, onChange, num = 5, readonly = false, disabled: disabledProp, size = 24, space = 6, color, activeColor = '#faad14', disabledColor, icon = 'star-fill', activeIcon = 'star-fill', allowHalf = false, clearable = false, block = false, className = '', style }) {
7
+ const field = useContext(FormFieldContext), disabled = disabledProp ?? field?.disabled ?? false;
8
+ const [inner, setInner] = useState(defaultValue);
9
+ const count = rateCount(num);
10
+ const score = rateScore(value === undefined ? inner : value, count);
11
+ const chosen = typeof activeColor === 'string' ? activeColor : activeColor[score <= count / 2 ? 0 : 1] ?? activeColor[0] ?? '#faad14';
12
+ const select = (next) => {
13
+ 'background only';
14
+ if (readonly || disabled)
15
+ return;
16
+ const nextValue = nextRateValue(score, next, allowHalf, clearable);
17
+ if (nextValue === score)
18
+ return;
19
+ if (value === undefined)
20
+ setInner(nextValue);
21
+ onChange?.({ value: nextValue });
22
+ };
23
+ const controlStyle = { '--ui-rate-size': loadingDimension(size), '--ui-rate-space': typeof space === 'number' ? `${Math.max(0, space)}px` : loadingDimension(space), ...style };
24
+ const idle = rateSvg(iconPaths[icon] ?? '', color ?? '#c9cbd4');
25
+ const filled = rateSvg(iconPaths[activeIcon] ?? '', disabled && disabledColor ? disabledColor : chosen);
26
+ return <view className={`ui-rate ${block ? 'ui-rate-block' : ''} ${disabled ? 'ui-rate-disabled' : ''} ${className}`} style={controlStyle}>
27
+ {Array.from({ length: count }, (_, index) => {
28
+ const fraction = Math.max(0, Math.min(1, score - index));
29
+ return <view className="ui-rate-item" key={index}>
30
+ {fraction < 1 ? <view className="ui-rate-empty" style={{ width: `${(1 - fraction) * 100}%` }}>
31
+ {color ? <svg className="ui-rate-glyph" content={idle}/> : <><svg className="ui-rate-glyph ui-rate-default-light" content={idle}/><svg className="ui-rate-glyph ui-rate-default-dark" content={rateSvg(iconPaths[icon] ?? '', '#6b7085')}/></>}
32
+ </view> : null}
33
+ {fraction > 0 ? <view className="ui-rate-fill" style={{ width: `${fraction * 100}%` }}><svg className="ui-rate-glyph" content={filled}/></view> : null}
34
+ {allowHalf ? <view className="ui-rate-hit ui-rate-hit-half" bindtap={() => select(index + .5)} accessibility-element accessibility-traits="button" accessibility-label={`${index + .5}分`}/> : null}
35
+ <view className={`ui-rate-hit ${allowHalf ? 'ui-rate-hit-full' : ''}`} bindtap={() => select(index + 1)} accessibility-element accessibility-traits="button" accessibility-label={`${index + 1}分`}/>
36
+ </view>;
37
+ })}
38
+ </view>;
39
+ }
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from '@lynx-js/react';
2
+ export type ResizeRect = {
3
+ width: number;
4
+ height: number;
5
+ top: number;
6
+ right: number;
7
+ bottom: number;
8
+ left: number;
9
+ };
10
+ export type ResizeProps = {
11
+ children?: ReactNode;
12
+ className?: string;
13
+ containerClassName?: string;
14
+ onResize?: (rect: ResizeRect) => void;
15
+ };
16
+ /** Reports initial geometry and subsequent size changes using native layout events. */
17
+ export declare function Resize({ children, className, containerClassName, onResize }: ResizeProps): import("@lynx-js/react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { useRef } from '@lynx-js/react';
2
+ /** Reports initial geometry and subsequent size changes using native layout events. */
3
+ export function Resize({ children, className = '', containerClassName = '', onResize }) {
4
+ const previous = useRef(null);
5
+ const handleLayout = (event) => {
6
+ 'background only';
7
+ const { width, height, top, right, bottom, left } = event.detail;
8
+ if (![width, height, top, right, bottom, left].every(Number.isFinite))
9
+ return;
10
+ if (previous.current?.width === width && previous.current.height === height)
11
+ return;
12
+ const rect = { width, height, top, right, bottom, left };
13
+ previous.current = rect;
14
+ onResize?.(rect);
15
+ };
16
+ return <view className={`ui-resize ${className}`}><view className={`ui-resize-container ${containerClassName}`} flatten={false} bindlayoutchange={handleLayout}>{children}</view></view>;
17
+ }
@@ -0,0 +1,133 @@
1
+ import type { ReactNode } from '@lynx-js/react';
2
+ import type { CSSProperties, NodesRef, StandardProps } from '@lynx-js/types';
3
+ import type { RichTextHeading, RichTextParseOptions } from './richTextModel.js';
4
+ import type { RichTextMediaEvent, RichTextMediaSignal, RichTextMediaTimeUpdate } from './richTextMedia.js';
5
+ export type { RichTextMediaEvent, RichTextMediaTimeUpdate } from './richTextMedia.js';
6
+ export type { RichTextHeading } from './richTextModel.js';
7
+ export type RichTextError = {
8
+ source: 'parse' | 'image' | 'audio' | 'video';
9
+ message?: string;
10
+ code?: string;
11
+ src?: string;
12
+ index?: number;
13
+ };
14
+ export type RichTextRect = {
15
+ top: number;
16
+ left: number;
17
+ width: number;
18
+ height: number;
19
+ };
20
+ export type RichTextRef = {
21
+ playMedia: (id: string) => boolean;
22
+ pauseMedia: (id?: string) => boolean;
23
+ seekMedia: (id: string, seconds: number) => boolean;
24
+ getText: () => string;
25
+ getHeadings: () => RichTextHeading[];
26
+ getAnchorRect: (id: string) => Promise<RichTextRect>;
27
+ scrollToAnchor: (id: string, options?: {
28
+ offset?: number;
29
+ duration?: number;
30
+ }) => Promise<void>;
31
+ };
32
+ export type RichTextProps = Omit<RichTextParseOptions, 'enableMedia'> & {
33
+ /** Browser only: first register the custom element from daisu-ui/web. */
34
+ mediaMode?: 'none' | 'browser';
35
+ onMediaPlay?: (event: RichTextMediaEvent) => void;
36
+ onMediaPause?: (event: RichTextMediaEvent) => void;
37
+ onMediaEnded?: (event: RichTextMediaEvent) => void;
38
+ onMediaTimeUpdate?: (event: RichTextMediaTimeUpdate) => void;
39
+ content?: string;
40
+ selectable?: boolean;
41
+ previewImage?: boolean;
42
+ loadingImage?: string;
43
+ errorImage?: string;
44
+ children?: ReactNode;
45
+ onLoad?: (event: {
46
+ imageCount: number;
47
+ }) => void;
48
+ onError?: (error: RichTextError) => void;
49
+ onLinkClick?: (event: {
50
+ href: string;
51
+ }) => void;
52
+ onImageClick?: (event: {
53
+ src: string;
54
+ index: number;
55
+ }) => void;
56
+ onImageLoad?: (event: {
57
+ src: string;
58
+ index: number;
59
+ width: number;
60
+ height: number;
61
+ }) => void;
62
+ /** Scroll the actual parent container using the measured viewport rect. */
63
+ onScrollToAnchor?: (target: {
64
+ id: string;
65
+ rect: RichTextRect;
66
+ offset: number;
67
+ duration: number;
68
+ }) => void | Promise<void>;
69
+ className?: string;
70
+ style?: CSSProperties;
71
+ };
72
+ type BrowserMediaProps = StandardProps & {
73
+ 'media-config': string;
74
+ ref?: ((node: NodesRef | null) => void) | {
75
+ current: NodesRef | null;
76
+ };
77
+ bindmediaevent?: (event: {
78
+ detail: RichTextMediaSignal;
79
+ }) => void;
80
+ };
81
+ declare module '@lynx-js/types' {
82
+ interface IntrinsicElements {
83
+ 'daisu-rich-media': BrowserMediaProps;
84
+ }
85
+ }
86
+ declare global {
87
+ namespace JSX {
88
+ interface IntrinsicElements {
89
+ 'daisu-rich-media': BrowserMediaProps;
90
+ }
91
+ }
92
+ }
93
+ /** HTML is parsed into native views, nested text, images and the public Table. */
94
+ export declare const RichText: (props: Omit<RichTextParseOptions, "enableMedia"> & {
95
+ /** Browser only: first register the custom element from daisu-ui/web. */
96
+ mediaMode?: "none" | "browser";
97
+ onMediaPlay?: (event: RichTextMediaEvent) => void;
98
+ onMediaPause?: (event: RichTextMediaEvent) => void;
99
+ onMediaEnded?: (event: RichTextMediaEvent) => void;
100
+ onMediaTimeUpdate?: (event: RichTextMediaTimeUpdate) => void;
101
+ content?: string;
102
+ selectable?: boolean;
103
+ previewImage?: boolean;
104
+ loadingImage?: string;
105
+ errorImage?: string;
106
+ children?: ReactNode;
107
+ onLoad?: (event: {
108
+ imageCount: number;
109
+ }) => void;
110
+ onError?: (error: RichTextError) => void;
111
+ onLinkClick?: (event: {
112
+ href: string;
113
+ }) => void;
114
+ onImageClick?: (event: {
115
+ src: string;
116
+ index: number;
117
+ }) => void;
118
+ onImageLoad?: (event: {
119
+ src: string;
120
+ index: number;
121
+ width: number;
122
+ height: number;
123
+ }) => void;
124
+ /** Scroll the actual parent container using the measured viewport rect. */
125
+ onScrollToAnchor?: (target: {
126
+ id: string;
127
+ rect: RichTextRect;
128
+ offset: number;
129
+ duration: number;
130
+ }) => void | Promise<void>;
131
+ className?: string;
132
+ style?: CSSProperties;
133
+ } & import("react").RefAttributes<RichTextRef>) => React.ReactElement | null;