@endfield-ui/react 1.1.0 → 1.2.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.
Files changed (496) hide show
  1. package/NOTICE.md +4 -3
  2. package/README.md +32 -5
  3. package/dist/components/accordion/Accordion.d.ts +46 -0
  4. package/dist/components/accordion/Accordion.js +2 -0
  5. package/dist/components/accordion/index.d.ts +3 -0
  6. package/dist/components/alert/Alert.d.ts +28 -0
  7. package/dist/components/alert/Alert.js +2 -0
  8. package/dist/components/alert/index.d.ts +3 -0
  9. package/dist/components/avatar/Avatar.d.ts +24 -0
  10. package/dist/components/avatar/Avatar.js +2 -0
  11. package/dist/components/avatar/AvatarSwitcher.d.ts +46 -0
  12. package/dist/components/avatar/AvatarSwitcher.js +2 -0
  13. package/dist/components/avatar/index.d.ts +4 -0
  14. package/dist/components/back-to-top/BackToTop.d.ts +21 -0
  15. package/dist/components/back-to-top/BackToTop.js +2 -0
  16. package/dist/components/back-to-top/index.d.ts +3 -0
  17. package/dist/components/badge/Badge.d.ts +20 -0
  18. package/dist/components/badge/Badge.js +2 -0
  19. package/dist/components/badge/index.d.ts +3 -0
  20. package/dist/components/bracket-title/BracketTitle.d.ts +17 -0
  21. package/dist/components/bracket-title/BracketTitle.js +2 -0
  22. package/dist/components/bracket-title/index.d.ts +3 -0
  23. package/dist/components/breadcrumb/Breadcrumb.d.ts +26 -0
  24. package/dist/components/breadcrumb/Breadcrumb.js +2 -0
  25. package/dist/components/breadcrumb/index.d.ts +3 -0
  26. package/dist/components/button/Button.d.ts +50 -0
  27. package/dist/components/button/Button.js +2 -0
  28. package/dist/components/button/ButtonGroup.d.ts +21 -0
  29. package/dist/components/button/ButtonGroup.js +2 -0
  30. package/dist/components/button/index.d.ts +4 -0
  31. package/dist/components/calendar/Calendar.d.ts +57 -0
  32. package/dist/components/calendar/Calendar.js +2 -0
  33. package/dist/components/calendar/index.d.ts +3 -0
  34. package/dist/components/carousel/Carousel.d.ts +38 -0
  35. package/dist/components/carousel/Carousel.js +2 -0
  36. package/dist/components/carousel/index.d.ts +3 -0
  37. package/dist/components/carousel/snap-track.js +2 -0
  38. package/dist/components/checkbox/Checkbox.d.ts +18 -0
  39. package/dist/components/checkbox/Checkbox.js +2 -0
  40. package/dist/components/checkbox/choice-style.js +2 -0
  41. package/dist/components/checkbox/index.d.ts +3 -0
  42. package/dist/components/chip/FilterChip.d.ts +18 -0
  43. package/dist/components/chip/FilterChip.js +2 -0
  44. package/dist/components/chip/ResourceChip.d.ts +16 -0
  45. package/dist/components/chip/ResourceChip.js +2 -0
  46. package/dist/components/chip/capsule-style.d.ts +4 -0
  47. package/dist/components/chip/capsule-style.js +2 -0
  48. package/dist/components/chip/index.d.ts +4 -0
  49. package/dist/components/combobox/Combobox.d.ts +105 -0
  50. package/dist/components/combobox/Combobox.js +2 -0
  51. package/dist/components/combobox/index.d.ts +3 -0
  52. package/dist/components/completion-banner/CompletionBanner.d.ts +26 -0
  53. package/dist/components/completion-banner/CompletionBanner.js +2 -0
  54. package/dist/components/completion-banner/index.d.ts +3 -0
  55. package/dist/components/context-menu/ContextMenu.d.ts +30 -0
  56. package/dist/components/context-menu/ContextMenu.js +2 -0
  57. package/dist/components/context-menu/index.d.ts +3 -0
  58. package/dist/components/corner-brackets/CornerBrackets.d.ts +20 -0
  59. package/dist/components/corner-brackets/CornerBrackets.js +2 -0
  60. package/dist/components/corner-brackets/index.d.ts +3 -0
  61. package/dist/components/countdown/Countdown.d.ts +26 -0
  62. package/dist/components/countdown/Countdown.js +2 -0
  63. package/dist/components/countdown/index.d.ts +3 -0
  64. package/dist/components/dash-indicator/DashIndicator.d.ts +15 -0
  65. package/dist/components/dash-indicator/DashIndicator.js +2 -0
  66. package/dist/components/dash-indicator/index.d.ts +3 -0
  67. package/dist/components/data-row/DataRow.d.ts +58 -0
  68. package/dist/components/data-row/DataRow.js +2 -0
  69. package/dist/components/data-row/index.d.ts +3 -0
  70. package/dist/components/date-picker/DateField.js +2 -0
  71. package/dist/components/date-picker/DatePicker.d.ts +56 -0
  72. package/dist/components/date-picker/DatePicker.js +2 -0
  73. package/dist/components/date-picker/DateRangePicker.d.ts +57 -0
  74. package/dist/components/date-picker/DateRangePicker.js +2 -0
  75. package/dist/components/date-picker/index.d.ts +4 -0
  76. package/dist/components/dialog/Dialog.d.ts +55 -0
  77. package/dist/components/dialog/Dialog.js +2 -0
  78. package/dist/components/dialog/index.d.ts +3 -0
  79. package/dist/components/dialog/initial-focus.js +2 -0
  80. package/dist/components/dialog/overlay-style.js +2 -0
  81. package/dist/components/drawer/Drawer.d.ts +48 -0
  82. package/dist/components/drawer/Drawer.js +2 -0
  83. package/dist/components/drawer/index.d.ts +3 -0
  84. package/dist/components/dropdown-menu/DropdownMenu.d.ts +115 -0
  85. package/dist/components/dropdown-menu/DropdownMenu.js +2 -0
  86. package/dist/components/dropdown-menu/MenuCheck.js +2 -0
  87. package/dist/components/dropdown-menu/index.d.ts +3 -0
  88. package/dist/components/dropdown-menu/menu-style.d.ts +4 -0
  89. package/dist/components/dropdown-menu/menu-style.js +2 -0
  90. package/dist/components/empty-state/EmptyState.d.ts +22 -0
  91. package/dist/components/empty-state/EmptyState.js +2 -0
  92. package/dist/components/empty-state/index.d.ts +3 -0
  93. package/dist/components/field/Field.d.ts +58 -0
  94. package/dist/components/field/Field.js +2 -0
  95. package/dist/components/field/index.d.ts +3 -0
  96. package/dist/components/file-upload/FileItem.d.ts +50 -0
  97. package/dist/components/file-upload/FileItem.js +2 -0
  98. package/dist/components/file-upload/FileUpload.d.ts +82 -0
  99. package/dist/components/file-upload/FileUpload.js +2 -0
  100. package/dist/components/file-upload/index.d.ts +4 -0
  101. package/dist/components/flyout-bar/FlyoutBar.d.ts +46 -0
  102. package/dist/components/flyout-bar/FlyoutBar.js +2 -0
  103. package/dist/components/flyout-bar/index.d.ts +3 -0
  104. package/dist/components/ghost-text/GhostText.d.ts +21 -0
  105. package/dist/components/ghost-text/GhostText.js +2 -0
  106. package/dist/components/ghost-text/index.d.ts +3 -0
  107. package/dist/components/hatch/Hatch.d.ts +18 -0
  108. package/dist/components/hatch/Hatch.js +2 -0
  109. package/dist/components/hatch/index.d.ts +3 -0
  110. package/dist/components/hazard-stripe/HazardStripe.d.ts +15 -0
  111. package/dist/components/hazard-stripe/HazardStripe.js +2 -0
  112. package/dist/components/hazard-stripe/index.d.ts +3 -0
  113. package/dist/components/hover-card/HoverCard.d.ts +35 -0
  114. package/dist/components/hover-card/HoverCard.js +2 -0
  115. package/dist/components/hover-card/index.d.ts +3 -0
  116. package/dist/components/icon-button/IconButton.d.ts +21 -0
  117. package/dist/components/icon-button/IconButton.js +2 -0
  118. package/dist/components/icon-button/index.d.ts +3 -0
  119. package/dist/components/image-viewer/ImageViewer.d.ts +48 -0
  120. package/dist/components/image-viewer/ImageViewer.js +2 -0
  121. package/dist/components/image-viewer/index.d.ts +3 -0
  122. package/dist/components/input/Input.d.ts +27 -0
  123. package/dist/components/input/Input.js +2 -0
  124. package/dist/components/input/control-box.d.ts +5 -0
  125. package/dist/components/input/control-box.js +2 -0
  126. package/dist/components/input/index.d.ts +3 -0
  127. package/dist/components/input/value-chip.js +2 -0
  128. package/dist/components/item-slot/ItemGrid.d.ts +12 -0
  129. package/dist/components/item-slot/ItemGrid.js +2 -0
  130. package/dist/components/item-slot/ItemSlot.d.ts +54 -0
  131. package/dist/components/item-slot/ItemSlot.js +2 -0
  132. package/dist/components/item-slot/index.d.ts +4 -0
  133. package/dist/components/kbd/Kbd.d.ts +15 -0
  134. package/dist/components/kbd/Kbd.js +2 -0
  135. package/dist/components/kbd/index.d.ts +3 -0
  136. package/dist/components/link-element/LinkElement.d.ts +6 -0
  137. package/dist/components/link-element/LinkElement.js +2 -0
  138. package/dist/components/list/List.d.ts +46 -0
  139. package/dist/components/list/List.js +2 -0
  140. package/dist/components/list/band-style.js +2 -0
  141. package/dist/components/list/index.d.ts +3 -0
  142. package/dist/components/loader/Loader.d.ts +23 -0
  143. package/dist/components/loader/Loader.js +2 -0
  144. package/dist/components/loader/index.d.ts +3 -0
  145. package/dist/components/marquee/Marquee.d.ts +22 -0
  146. package/dist/components/marquee/Marquee.js +2 -0
  147. package/dist/components/marquee/index.d.ts +3 -0
  148. package/dist/components/media-card/MediaCard.d.ts +36 -0
  149. package/dist/components/media-card/MediaCard.js +2 -0
  150. package/dist/components/media-card/index.d.ts +3 -0
  151. package/dist/components/nav-action/NavAction.d.ts +34 -0
  152. package/dist/components/nav-action/NavAction.js +2 -0
  153. package/dist/components/nav-action/index.d.ts +3 -0
  154. package/dist/components/nav-menu/NavMenu.d.ts +57 -0
  155. package/dist/components/nav-menu/NavMenu.js +2 -0
  156. package/dist/components/nav-menu/index.d.ts +3 -0
  157. package/dist/components/navigator/Navigator.d.ts +27 -0
  158. package/dist/components/navigator/Navigator.js +2 -0
  159. package/dist/components/navigator/index.d.ts +3 -0
  160. package/dist/components/otp-input/OtpInput.d.ts +52 -0
  161. package/dist/components/otp-input/OtpInput.js +2 -0
  162. package/dist/components/otp-input/index.d.ts +3 -0
  163. package/dist/components/page-header/PageHeader.d.ts +56 -0
  164. package/dist/components/page-header/PageHeader.js +2 -0
  165. package/dist/components/page-header/index.d.ts +3 -0
  166. package/dist/components/pagination/Pagination.d.ts +29 -0
  167. package/dist/components/pagination/Pagination.js +2 -0
  168. package/dist/components/pagination/index.d.ts +3 -0
  169. package/dist/components/panel/Panel.d.ts +36 -0
  170. package/dist/components/panel/Panel.js +2 -0
  171. package/dist/components/panel/index.d.ts +3 -0
  172. package/dist/components/play-button/PlayButton.d.ts +20 -0
  173. package/dist/components/play-button/PlayButton.js +2 -0
  174. package/dist/components/play-button/index.d.ts +3 -0
  175. package/dist/components/popover/Popover.d.ts +36 -0
  176. package/dist/components/popover/Popover.js +2 -0
  177. package/dist/components/popover/index.d.ts +3 -0
  178. package/dist/components/popover/panel-style.js +2 -0
  179. package/dist/components/progress/Progress.d.ts +27 -0
  180. package/dist/components/progress/Progress.js +2 -0
  181. package/dist/components/progress/ProgressRing.d.ts +23 -0
  182. package/dist/components/progress/ProgressRing.js +2 -0
  183. package/dist/components/progress/index.d.ts +4 -0
  184. package/dist/components/radio/Radio.d.ts +33 -0
  185. package/dist/components/radio/Radio.js +2 -0
  186. package/dist/components/radio/index.d.ts +3 -0
  187. package/dist/components/rec-indicator/RecIndicator.d.ts +16 -0
  188. package/dist/components/rec-indicator/RecIndicator.js +2 -0
  189. package/dist/components/rec-indicator/index.d.ts +3 -0
  190. package/dist/components/registration-strip/RegistrationStrip.d.ts +16 -0
  191. package/dist/components/registration-strip/RegistrationStrip.js +2 -0
  192. package/dist/components/registration-strip/index.d.ts +3 -0
  193. package/dist/components/rolling-number/RollingNumber.d.ts +25 -0
  194. package/dist/components/rolling-number/RollingNumber.js +2 -0
  195. package/dist/components/rolling-number/index.d.ts +3 -0
  196. package/dist/components/schedule/Schedule.d.ts +78 -0
  197. package/dist/components/schedule/Schedule.js +2 -0
  198. package/dist/components/schedule/index.d.ts +3 -0
  199. package/dist/components/scroll-area/ScrollArea.d.ts +26 -0
  200. package/dist/components/scroll-area/ScrollArea.js +2 -0
  201. package/dist/components/scroll-area/index.d.ts +3 -0
  202. package/dist/components/scroll-hint/ScrollHint.d.ts +23 -0
  203. package/dist/components/scroll-hint/ScrollHint.js +2 -0
  204. package/dist/components/scroll-hint/index.d.ts +3 -0
  205. package/dist/components/section-title/SectionTitle.d.ts +33 -0
  206. package/dist/components/section-title/SectionTitle.js +2 -0
  207. package/dist/components/section-title/index.d.ts +3 -0
  208. package/dist/components/segmented-control/SegmentedControl.d.ts +49 -0
  209. package/dist/components/segmented-control/SegmentedControl.js +2 -0
  210. package/dist/components/segmented-control/index.d.ts +3 -0
  211. package/dist/components/select/Select.d.ts +95 -0
  212. package/dist/components/select/Select.js +2 -0
  213. package/dist/components/select/index.d.ts +3 -0
  214. package/dist/components/side-rail/SideRail.d.ts +62 -0
  215. package/dist/components/side-rail/SideRail.js +2 -0
  216. package/dist/components/side-rail/SideRailSub.d.ts +47 -0
  217. package/dist/components/side-rail/SideRailSub.js +2 -0
  218. package/dist/components/side-rail/index.d.ts +4 -0
  219. package/dist/components/skeleton/Skeleton.d.ts +22 -0
  220. package/dist/components/skeleton/Skeleton.js +2 -0
  221. package/dist/components/skeleton/index.d.ts +3 -0
  222. package/dist/components/slider/Slider.d.ts +63 -0
  223. package/dist/components/slider/Slider.js +2 -0
  224. package/dist/components/slider/index.d.ts +3 -0
  225. package/dist/components/sparkline/Sparkline.d.ts +32 -0
  226. package/dist/components/sparkline/Sparkline.js +2 -0
  227. package/dist/components/sparkline/index.d.ts +3 -0
  228. package/dist/components/spinner/Spinner.d.ts +19 -0
  229. package/dist/components/spinner/Spinner.js +2 -0
  230. package/dist/components/spinner/index.d.ts +3 -0
  231. package/dist/components/splash-screen/SplashScreen.d.ts +43 -0
  232. package/dist/components/splash-screen/SplashScreen.js +2 -0
  233. package/dist/components/splash-screen/index.d.ts +3 -0
  234. package/dist/components/stat/Stat.d.ts +22 -0
  235. package/dist/components/stat/Stat.js +2 -0
  236. package/dist/components/stat/index.d.ts +3 -0
  237. package/dist/components/stepper/Stepper.d.ts +29 -0
  238. package/dist/components/stepper/Stepper.js +2 -0
  239. package/dist/components/stepper/index.d.ts +3 -0
  240. package/dist/components/steps/Steps.d.ts +55 -0
  241. package/dist/components/steps/Steps.js +2 -0
  242. package/dist/components/steps/index.d.ts +3 -0
  243. package/dist/components/switch/Switch.d.ts +28 -0
  244. package/dist/components/switch/Switch.js +2 -0
  245. package/dist/components/switch/index.d.ts +3 -0
  246. package/dist/components/table/Table.d.ts +96 -0
  247. package/dist/components/table/Table.js +2 -0
  248. package/dist/components/table/index.d.ts +3 -0
  249. package/dist/components/tabs/Tabs.d.ts +39 -0
  250. package/dist/components/tabs/Tabs.js +2 -0
  251. package/dist/components/tabs/index.d.ts +3 -0
  252. package/dist/components/tag/Tag.d.ts +25 -0
  253. package/dist/components/tag/Tag.js +2 -0
  254. package/dist/components/tag/TagPair.d.ts +16 -0
  255. package/dist/components/tag/TagPair.js +2 -0
  256. package/dist/components/tag/index.d.ts +4 -0
  257. package/dist/components/tag-input/TagInput.d.ts +66 -0
  258. package/dist/components/tag-input/TagInput.js +3 -0
  259. package/dist/components/tag-input/index.d.ts +3 -0
  260. package/dist/components/term/Term.d.ts +19 -0
  261. package/dist/components/term/Term.js +2 -0
  262. package/dist/components/term/index.d.ts +3 -0
  263. package/dist/components/textarea/Textarea.d.ts +17 -0
  264. package/dist/components/textarea/Textarea.js +2 -0
  265. package/dist/components/textarea/index.d.ts +3 -0
  266. package/dist/components/texture/Texture.d.ts +19 -0
  267. package/dist/components/texture/Texture.js +2 -0
  268. package/dist/components/texture/index.d.ts +3 -0
  269. package/dist/components/tick-ring/TickRing.d.ts +22 -0
  270. package/dist/components/tick-ring/TickRing.js +2 -0
  271. package/dist/components/tick-ring/index.d.ts +3 -0
  272. package/dist/components/timeline/Timeline.d.ts +22 -0
  273. package/dist/components/timeline/Timeline.js +2 -0
  274. package/dist/components/timeline/index.d.ts +3 -0
  275. package/dist/components/toast/Toast.d.ts +45 -0
  276. package/dist/components/toast/Toast.js +2 -0
  277. package/dist/components/toast/index.d.ts +3 -0
  278. package/dist/components/toc/Toc.d.ts +46 -0
  279. package/dist/components/toc/Toc.js +2 -0
  280. package/dist/components/toc/index.d.ts +3 -0
  281. package/dist/components/toolbar/Toolbar.d.ts +97 -0
  282. package/dist/components/toolbar/Toolbar.js +2 -0
  283. package/dist/components/toolbar/index.d.ts +3 -0
  284. package/dist/components/tooltip/Tooltip.d.ts +47 -0
  285. package/dist/components/tooltip/Tooltip.js +2 -0
  286. package/dist/components/tooltip/index.d.ts +3 -0
  287. package/dist/components/top-bar/TopBar.d.ts +21 -0
  288. package/dist/components/top-bar/TopBar.js +2 -0
  289. package/dist/components/top-bar/index.d.ts +3 -0
  290. package/dist/components/viewfinder/Viewfinder.d.ts +35 -0
  291. package/dist/components/viewfinder/Viewfinder.js +2 -0
  292. package/dist/components/viewfinder/index.d.ts +3 -0
  293. package/dist/game/animated-dialog/AnimatedDialog.d.ts +53 -0
  294. package/dist/game/animated-dialog/AnimatedDialog.js +2 -0
  295. package/dist/game/animated-dialog/index.d.ts +3 -0
  296. package/dist/game/assets/splash_bg.jpg +0 -0
  297. package/dist/game/assets/splash_bg_portrait.jpg +0 -0
  298. package/dist/game/assets/splash_deco.svg +4 -0
  299. package/dist/game/assets/splash_logo.svg +1 -0
  300. package/dist/game/assets/splash_triangles.svg +4 -0
  301. package/dist/game/banner-alert/AlertIcons.js +2 -0
  302. package/dist/game/banner-alert/AlertModal.js +2 -0
  303. package/dist/game/banner-alert/BannerAlert.d.ts +6 -0
  304. package/dist/game/banner-alert/BannerAlert.js +2 -0
  305. package/dist/game/banner-alert/index.d.ts +3 -0
  306. package/dist/game/banner-alert/types.d.ts +48 -0
  307. package/dist/game/banner-alert/types.js +2 -0
  308. package/dist/game/banner-alert/useAlertActions.js +2 -0
  309. package/dist/game/banner-alert/useAlertGlitch.js +2 -0
  310. package/dist/game/full-width-alert/FullWidthAlert.d.ts +7 -0
  311. package/dist/game/full-width-alert/FullWidthAlert.js +2 -0
  312. package/dist/game/full-width-alert/index.d.ts +3 -0
  313. package/dist/game/item-card/ItemCard.d.ts +48 -0
  314. package/dist/game/item-card/ItemCard.js +2 -0
  315. package/dist/game/item-card/index.d.ts +3 -0
  316. package/dist/game/item-hover-card/ItemHoverCard.d.ts +31 -0
  317. package/dist/game/item-hover-card/ItemHoverCard.js +2 -0
  318. package/dist/game/item-hover-card/events.js +2 -0
  319. package/dist/game/item-hover-card/index.d.ts +3 -0
  320. package/dist/game/item-icon/ItemIcon.d.ts +5 -0
  321. package/dist/game/item-icon/ItemIcon.js +2 -0
  322. package/dist/game/item-icon/helpers.d.ts +22 -0
  323. package/dist/game/item-icon/helpers.js +2 -0
  324. package/dist/game/item-icon/index.d.ts +5 -0
  325. package/dist/game/item-icon/types.d.ts +32 -0
  326. package/dist/game/item-tooltip-card/ItemTooltipCard.d.ts +6 -0
  327. package/dist/game/item-tooltip-card/ItemTooltipCard.js +2 -0
  328. package/dist/game/item-tooltip-card/icons.js +2 -0
  329. package/dist/game/item-tooltip-card/index.d.ts +4 -0
  330. package/dist/game/item-tooltip-card/types.d.ts +40 -0
  331. package/dist/game/lib/core.d.ts +8 -0
  332. package/dist/game/lib/first-focusable.js +2 -0
  333. package/dist/game/resource-provenance.json +70 -1
  334. package/dist/game/rounded-button/RoundedButton.d.ts +22 -0
  335. package/dist/game/rounded-button/RoundedButton.js +2 -0
  336. package/dist/game/rounded-button/RoundedIconButton.d.ts +10 -0
  337. package/dist/game/rounded-button/RoundedIconButton.js +2 -0
  338. package/dist/game/rounded-button/index.d.ts +4 -0
  339. package/dist/game/rounded-select/RoundedSelect.d.ts +43 -0
  340. package/dist/game/rounded-select/RoundedSelect.js +2 -0
  341. package/dist/game/rounded-select/index.d.ts +3 -0
  342. package/dist/game/rounded-switch/RoundedSwitch.d.ts +16 -0
  343. package/dist/game/rounded-switch/RoundedSwitch.js +2 -0
  344. package/dist/game/rounded-switch/index.d.ts +3 -0
  345. package/dist/game/rounded-toggle/RoundedToggle.d.ts +23 -0
  346. package/dist/game/rounded-toggle/RoundedToggle.js +2 -0
  347. package/dist/game/rounded-toggle/index.d.ts +3 -0
  348. package/dist/game/rounded-toggle/keyboard.js +2 -0
  349. package/dist/game/rounded-toggle/spring-highlight.js +2 -0
  350. package/dist/game/splash-screen/EndfieldSplashScreen.d.ts +14 -0
  351. package/dist/game/splash-screen/EndfieldSplashScreen.js +2 -0
  352. package/dist/game/splash-screen/index.d.ts +3 -0
  353. package/dist/game/styles.css +1 -1
  354. package/dist/game.d.ts +29 -371
  355. package/dist/game.js +1 -2041
  356. package/dist/hooks/index.d.ts +7 -0
  357. package/dist/hooks/useAddedKeys.js +2 -0
  358. package/dist/hooks/useControllableState.d.ts +12 -0
  359. package/dist/hooks/useControllableState.js +2 -0
  360. package/dist/hooks/useFlip.js +2 -0
  361. package/dist/hooks/useInView.d.ts +15 -0
  362. package/dist/hooks/useInView.js +2 -0
  363. package/dist/hooks/useIndicator.js +2 -0
  364. package/dist/hooks/useLingering.js +2 -0
  365. package/dist/hooks/useOverflowing.js +2 -0
  366. package/dist/hooks/usePortalScope.d.ts +26 -0
  367. package/dist/hooks/usePortalScope.js +2 -0
  368. package/dist/hooks/usePresence.js +2 -0
  369. package/dist/hooks/useReducedMotion.d.ts +10 -0
  370. package/dist/hooks/useReducedMotion.js +2 -0
  371. package/dist/hooks/useScrollPosition.js +2 -0
  372. package/dist/hooks/useTheme.d.ts +21 -0
  373. package/dist/hooks/useTheme.js +2 -0
  374. package/dist/icons/ArrowCorner.d.ts +9 -0
  375. package/dist/icons/ArrowCorner.js +2 -0
  376. package/dist/icons/ArrowLeft.d.ts +8 -0
  377. package/dist/icons/ArrowLeft.js +2 -0
  378. package/dist/icons/ArrowRight.d.ts +8 -0
  379. package/dist/icons/ArrowRight.js +2 -0
  380. package/dist/icons/CalendarIcon.d.ts +12 -0
  381. package/dist/icons/CalendarIcon.js +2 -0
  382. package/dist/icons/Check.d.ts +9 -0
  383. package/dist/icons/Check.js +2 -0
  384. package/dist/icons/ChevronDown.d.ts +8 -0
  385. package/dist/icons/ChevronDown.js +2 -0
  386. package/dist/icons/ChevronLeft.d.ts +8 -0
  387. package/dist/icons/ChevronLeft.js +2 -0
  388. package/dist/icons/ChevronRight.d.ts +8 -0
  389. package/dist/icons/ChevronRight.js +2 -0
  390. package/dist/icons/Close.d.ts +8 -0
  391. package/dist/icons/Close.js +2 -0
  392. package/dist/icons/Crosshair.d.ts +9 -0
  393. package/dist/icons/Crosshair.js +2 -0
  394. package/dist/icons/Lock.d.ts +8 -0
  395. package/dist/icons/Lock.js +2 -0
  396. package/dist/icons/Menu.d.ts +9 -0
  397. package/dist/icons/Menu.js +2 -0
  398. package/dist/icons/Minus.d.ts +9 -0
  399. package/dist/icons/Minus.js +2 -0
  400. package/dist/icons/Plus.d.ts +8 -0
  401. package/dist/icons/Plus.js +2 -0
  402. package/dist/icons/StatusDanger.d.ts +9 -0
  403. package/dist/icons/StatusDanger.js +2 -0
  404. package/dist/icons/StatusInfo.d.ts +9 -0
  405. package/dist/icons/StatusInfo.js +2 -0
  406. package/dist/icons/StatusSuccess.d.ts +9 -0
  407. package/dist/icons/StatusSuccess.js +2 -0
  408. package/dist/icons/StatusWarning.d.ts +9 -0
  409. package/dist/icons/StatusWarning.js +2 -0
  410. package/dist/icons/TriangleRight.d.ts +9 -0
  411. package/dist/icons/TriangleRight.js +2 -0
  412. package/dist/icons/Upload.d.ts +9 -0
  413. package/dist/icons/Upload.js +2 -0
  414. package/dist/icons/createIcon.d.ts +16 -0
  415. package/dist/icons/createIcon.js +2 -0
  416. package/dist/icons/index.d.ts +23 -0
  417. package/dist/index.d.ts +209 -3505
  418. package/dist/index.js +1 -9625
  419. package/dist/lib/cn.d.ts +5 -0
  420. package/dist/lib/cn.js +2 -0
  421. package/dist/lib/create-lazy-context.js +2 -0
  422. package/dist/lib/date.js +2 -0
  423. package/dist/lib/decor.js +2 -0
  424. package/dist/lib/defined.js +2 -0
  425. package/dist/lib/file.js +2 -0
  426. package/dist/lib/focus-ring.js +2 -0
  427. package/dist/lib/inline-style.js +2 -0
  428. package/dist/lib/merge-refs.js +2 -0
  429. package/dist/lib/motion.js +2 -0
  430. package/dist/styles.css +1 -1
  431. package/package.json +17 -11
  432. package/src/components/accordion/Accordion.tsx +13 -5
  433. package/src/components/alert/Alert.tsx +1 -1
  434. package/src/components/avatar/AvatarSwitcher.tsx +7 -5
  435. package/src/components/carousel/Carousel.tsx +6 -5
  436. package/src/components/context-menu/ContextMenu.tsx +5 -2
  437. package/src/components/data-row/DataRow.tsx +10 -4
  438. package/src/components/date-picker/DateField.tsx +1 -3
  439. package/src/components/dropdown-menu/DropdownMenu.tsx +7 -4
  440. package/src/components/dropdown-menu/menu-style.ts +9 -3
  441. package/src/components/field/Field.tsx +10 -6
  442. package/src/components/file-upload/FileUpload.tsx +5 -2
  443. package/src/components/flyout-bar/FlyoutBar.tsx +1 -1
  444. package/src/components/image-viewer/ImageViewer.tsx +6 -5
  445. package/src/components/input/control-box.ts +30 -10
  446. package/src/components/list/List.tsx +7 -5
  447. package/src/components/nav-action/NavAction.tsx +4 -3
  448. package/src/components/nav-menu/NavMenu.tsx +13 -7
  449. package/src/components/otp-input/OtpInput.tsx +35 -43
  450. package/src/components/radio/Radio.tsx +7 -5
  451. package/src/components/schedule/Schedule.tsx +7 -5
  452. package/src/components/segmented-control/SegmentedControl.tsx +9 -7
  453. package/src/components/select/Select.tsx +11 -11
  454. package/src/components/side-rail/SideRail.tsx +15 -9
  455. package/src/components/side-rail/SideRailSub.tsx +12 -7
  456. package/src/components/splash-screen/SplashScreen.tsx +340 -0
  457. package/src/components/splash-screen/index.ts +1 -0
  458. package/src/components/steps/Steps.tsx +7 -5
  459. package/src/components/table/Table.tsx +23 -17
  460. package/src/components/tabs/Tabs.tsx +7 -5
  461. package/src/components/tag-input/TagInput.tsx +5 -2
  462. package/src/components/toast/Toast.tsx +12 -8
  463. package/src/components/toc/Toc.tsx +5 -4
  464. package/src/components/toolbar/Toolbar.tsx +7 -6
  465. package/src/components/tooltip/Tooltip.tsx +7 -4
  466. package/src/components/top-bar/TopBar.tsx +7 -2
  467. package/src/icons/ArrowCorner.tsx +1 -1
  468. package/src/icons/ArrowLeft.tsx +1 -1
  469. package/src/icons/ArrowRight.tsx +1 -1
  470. package/src/icons/CalendarIcon.tsx +1 -1
  471. package/src/icons/Check.tsx +4 -1
  472. package/src/icons/ChevronDown.tsx +4 -1
  473. package/src/icons/ChevronLeft.tsx +1 -1
  474. package/src/icons/ChevronRight.tsx +1 -1
  475. package/src/icons/Close.tsx +4 -1
  476. package/src/icons/Crosshair.tsx +1 -1
  477. package/src/icons/Lock.tsx +1 -1
  478. package/src/icons/Menu.tsx +4 -1
  479. package/src/icons/Minus.tsx +1 -1
  480. package/src/icons/Plus.tsx +4 -1
  481. package/src/icons/StatusDanger.tsx +1 -1
  482. package/src/icons/StatusInfo.tsx +1 -1
  483. package/src/icons/StatusSuccess.tsx +1 -1
  484. package/src/icons/StatusWarning.tsx +1 -1
  485. package/src/icons/TriangleRight.tsx +1 -1
  486. package/src/icons/Upload.tsx +1 -1
  487. package/src/index.ts +1 -0
  488. package/src/lib/cn.ts +1 -1
  489. package/src/lib/create-lazy-context.ts +6 -0
  490. package/src/styles/theme.css +33 -0
  491. package/src/styles/utilities.css +8 -0
  492. package/src/components/README.md +0 -190
  493. package/src/hooks/README.md +0 -20
  494. package/src/icons/README.md +0 -31
  495. package/src/lib/README.md +0 -19
  496. package/src/styles/README.md +0 -74
@@ -0,0 +1,20 @@
1
+
2
+ import { ComponentProps } from "react";
3
+ //#region src/components/play-button/PlayButton.d.ts
4
+ export type PlayMarkSize = "sm" | "md" | "lg";
5
+ export type PlayMarkProps = Omit<ComponentProps<"span">, "children"> & {
6
+ size?: PlayMarkSize;
7
+ };
8
+ /**
9
+ * 播放记号:只是一个记号,不能点,对读屏隐藏。
10
+ * 整张卡已经是一个链接时用它(媒体卡的 `video`);要它自己能点用 `PlayButton`。
11
+ */
12
+ export declare function PlayMark({ size, className, ...props }: PlayMarkProps): import("react").JSX.Element;
13
+ export type PlayButtonProps = Omit<ComponentProps<"button">, "children" | "aria-label"> & {
14
+ /** 默认"播放"。一页有好几个时写明播的是什么 */
15
+ "aria-label"?: string;
16
+ size?: PlayMarkSize;
17
+ };
18
+ /** 播放钮:和播放记号同一个画法的按钮,给"点了就在原地播放"的封面用。 */
19
+ export declare function PlayButton({ "aria-label": ariaLabel, size, type, disabled, className, ...props }: PlayButtonProps): import("react").JSX.Element;
20
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{focusRing as t}from"../../lib/focus-ring.js";import{TriangleRight as n}from"../../icons/TriangleRight.js";import{jsx as r}from"react/jsx-runtime";const i={sm:`size-6 [&_svg]:size-3`,md:`size-8 [&_svg]:size-4`,lg:`size-10 [&_svg]:size-5`},a=`inline-flex shrink-0 items-center justify-center rounded-xs bg-action text-on-action`;function o({size:t=`md`,className:o,...s}){return/* @__PURE__ */ r(`span`,{"aria-hidden":`true`,...s,"data-size":t,className:e(a,i[t],o),children:/* @__PURE__ */ r(n,{})})}function s({"aria-label":o=`播放`,size:s=`md`,type:c=`button`,disabled:l=!1,className:u,...d}){return/* @__PURE__ */ r(`button`,{...d,type:c,disabled:l,"aria-label":o,"data-size":s,className:e(`group relative`,a,i[s],`transition-colors duration-(--duration-fast) ease-standard`,t,s===`sm`&&`after:absolute after:-inset-2 after:content-['']`,l?`cursor-not-allowed bg-disabled text-on-disabled`:`active:bg-action-pressed`,u),children:/* @__PURE__ */ r(n,{className:e(`transition-[translate] duration-(--duration-base) ease-standard`,!l&&`group-hover:translate-x-0.5 group-active:translate-x-0.5`)})})}export{s as PlayButton,o as PlayMark};
@@ -0,0 +1,3 @@
1
+
2
+ import { PlayButton, PlayButtonProps, PlayMark, PlayMarkProps, PlayMarkSize } from "./PlayButton.js";
3
+ export { PlayButton, type PlayButtonProps, PlayMark, type PlayMarkProps, type PlayMarkSize };
@@ -0,0 +1,36 @@
1
+
2
+ import { ComponentProps, ReactElement, ReactNode } from "react";
3
+ //#region src/components/popover/Popover.d.ts
4
+ export type PopoverSide = "top" | "bottom" | "left" | "right";
5
+ export type PopoverAlign = "start" | "center" | "end";
6
+ export type PopoverProps = Omit<ComponentProps<"div">, "title" | "children" | "className" | "style"> & {
7
+ /** 触发按钮 */
8
+ trigger: ReactElement<Record<string, unknown>>;
9
+ /** 标题。有它时它就是面板的可访问名称;没有时自己传 `aria-label` */
10
+ title?: ReactNode;
11
+ /** 标题下的一行说明,会关联给读屏 */
12
+ description?: ReactNode;
13
+ /** 面板出现在触发按钮的哪一侧,放不下时自动翻到对面。默认 `bottom` */
14
+ side?: PopoverSide;
15
+ /** 和触发按钮的哪一边对齐。默认 `start` */
16
+ align?: PopoverAlign;
17
+ open?: boolean;
18
+ defaultOpen?: boolean;
19
+ onOpenChange?: (open: boolean) => void;
20
+ /** 给面板 */
21
+ className?: string;
22
+ children?: ReactNode;
23
+ };
24
+ /**
25
+ * 气泡卡片:点击触发、里面可以操作的一小块面板。不是模态——页面其余部分照常可用,
26
+ * 点别处、按 `Esc`、焦点移出去都会关。只是一句说明用 `Tooltip`,
27
+ * 必须做完才能继续的用 `Dialog`。
28
+ */
29
+ export declare function Popover({ trigger, title, description, side, align, open, defaultOpen, onOpenChange, className, children, ...props }: PopoverProps): import("react").JSX.Element;
30
+ export type PopoverCloseProps = {
31
+ /** 点了就关掉面板的按钮,比如"完成" */
32
+ children: ReactElement<Record<string, unknown>>;
33
+ };
34
+ /** 包住面板里"点了就关"的按钮。 */
35
+ export declare function PopoverClose({ children }: PopoverCloseProps): import("react").JSX.Element;
36
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{usePortalScope as t}from"../../hooks/usePortalScope.js";import{popoverPanel as n}from"./panel-style.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{Popover as a}from"@base-ui/react/popover";function o({trigger:o,title:s,description:c,side:l=`bottom`,align:u=`start`,open:d,defaultOpen:f,onOpenChange:p,className:m,children:h,...g}){let{anchorRef:_,portalRef:v}=t();return/* @__PURE__ */ i(a.Root,{open:d,defaultOpen:f,onOpenChange:p&&(e=>p(e)),children:[/* @__PURE__ */ r(a.Trigger,{ref:_,render:o}),/* @__PURE__ */ r(a.Portal,{ref:v,children:/* @__PURE__ */ r(a.Positioner,{side:l,align:u,sideOffset:4,className:`z-(--z-overlay) outline-none`,children:/* @__PURE__ */ i(a.Popup,{...g,className:e(n,m),children:[(s||c)&&/* @__PURE__ */ i(`div`,{className:`flex flex-col gap-1`,children:[s&&/* @__PURE__ */ r(a.Title,{className:`text-base font-bold`,children:s}),c&&/* @__PURE__ */ r(a.Description,{className:`text-ink-secondary`,children:c})]}),h]})})})]})}function s({children:e}){return/* @__PURE__ */ r(a.Close,{render:e})}export{o as Popover,s as PopoverClose};
@@ -0,0 +1,3 @@
1
+
2
+ import { Popover, PopoverAlign, PopoverClose, PopoverCloseProps, PopoverProps, PopoverSide } from "./Popover.js";
3
+ export { Popover, type PopoverAlign, PopoverClose, type PopoverCloseProps, type PopoverProps, type PopoverSide };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{menuPanel as e}from"../dropdown-menu/menu-style.js";const t=[e,`flex w-max max-w-[min(20rem,var(--available-width))] flex-col gap-3 p-4 text-sm wrap-anywhere`],n=`text-base font-bold`,r=`text-ink-secondary`;export{r as popoverDescription,t as popoverPanel,n as popoverTitle};
@@ -0,0 +1,27 @@
1
+
2
+ import { ComponentProps, ReactNode } from "react";
3
+ //#region src/components/progress/Progress.d.ts
4
+ export type ProgressSize = "sm" | "md";
5
+ export type ProgressProps = Omit<ComponentProps<"div">, "children"> & {
6
+ /** 当前值。不传就是"不确定进度":一段色块在轨道上往返 */
7
+ value?: number;
8
+ /** 最大值,默认 100;分段进度下默认等于段数 */
9
+ max?: number;
10
+ /** 步骤数明确时把轨道切成等长的小段,`value` 是已完成的段数 */
11
+ segments?: number;
12
+ /** 4px 细条或 8px 标准条 */
13
+ size?: ProgressSize;
14
+ /** 在右侧显示数值:百分比,分段时是 `3 / 6` */
15
+ showValue?: boolean;
16
+ /** 自定义数值的写法 */
17
+ formatValue?: (value: number, max: number) => ReactNode;
18
+ /** 入场时从左侧充填一次 */
19
+ animate?: boolean;
20
+ };
21
+ /**
22
+ * 进度:灰轨 + 黄填充。表示"完成了多少";表示"数量有多少"用图表,那是蓝色的事。
23
+ *
24
+ * `className` 给外层,其余属性(`aria-label` 等)给带 `role="progressbar"` 的轨道。
25
+ */
26
+ export declare function Progress({ value, max, segments, size, showValue, formatValue, animate, className, style, ...props }: ProgressProps): import("react").JSX.Element;
27
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";const r={sm:`h-1`,md:`h-2`},i=`bg-action forced-colors:bg-[Highlight]`,a=`bg-line forced-colors:outline forced-colors:-outline-offset-1 forced-colors:outline-[CanvasText]`;function o({value:o,max:s,segments:c,size:l=`md`,showValue:u=!1,formatValue:d,animate:f=!1,className:p,style:m,...h}){let g=c!==void 0&&c>0,_=s??(g?c:100),v=o===void 0,y=v?0:Math.min(Math.max(o,0),_),b=_>0?y/_:0,x;if(g){let n=Math.round(b*c);x=/* @__PURE__ */ t(`span`,{className:`flex h-full gap-1`,children:Array.from({length:c},(r,o)=>/* @__PURE__ */ t(`span`,{"data-done":o<n?``:void 0,className:e(`flex-1`,o<n?i:a)},o))})}else v?x=/* @__PURE__ */ t(`span`,{className:e(`absolute inset-y-0 left-0 w-2/5 animate-indeterminate`,`motion-reduce:translate-x-3/4`,i)}):b>0&&(x=/* @__PURE__ */ t(`span`,{className:e(`absolute inset-y-0 left-0 transition-[width] duration-(--duration-base) ease-standard`,f&&`origin-left animate-fill`,i),style:{width:`${b*100}%`}}));let S=null;return u&&!v&&(S=d?d(y,_):g?`${y} / ${_}`:`${Math.round(b*100)}%`),/* @__PURE__ */ n(`div`,{className:e(`flex items-center gap-3 text-ink`,p),style:m,"data-size":l,children:[/* @__PURE__ */ t(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":_,"aria-valuenow":v?void 0:y,"aria-valuetext":g&&!v?`${y} / ${_}`:void 0,...h,className:e(`relative min-w-0 flex-1`,r[l],!g&&a),children:x}),S!==null&&/* @__PURE__ */ t(`span`,{className:`min-w-[4ch] shrink-0 text-right font-tech text-sm leading-none font-bold tabular-nums`,children:S})]})}export{o as Progress};
@@ -0,0 +1,23 @@
1
+
2
+ import { ComponentProps, ReactNode } from "react";
3
+ //#region src/components/progress/ProgressRing.d.ts
4
+ export type ProgressRingProps = Omit<ComponentProps<"div">, "children"> & {
5
+ /** 当前值。不传就是"不确定进度":一段弧匀速旋转 */
6
+ value?: number;
7
+ /** 最大值,默认 100 */
8
+ max?: number;
9
+ /** 直径,像素,默认 48 */
10
+ size?: number;
11
+ /** 线宽,像素,缺省取直径的 9% */
12
+ thickness?: number;
13
+ /** 在中心显示百分比的数值,不带 `%` */
14
+ showValue?: boolean;
15
+ /** 中心的内容:图标或头像。传了就不显示数值 */
16
+ children?: ReactNode;
17
+ };
18
+ /**
19
+ * 进度环:细圆环轨道 + 从 12 点方向顺时针的黄弧。用在紧凑的位置,或者围住一个头像、图标。
20
+ * 取色与 `Progress` 相同;需要名称时传 `aria-label`。
21
+ */
22
+ export declare function ProgressRing({ value, max, size, thickness, showValue, className, style, children, ...props }: ProgressRingProps): import("react").JSX.Element;
23
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{Fragment as t,jsx as n,jsxs as r}from"react/jsx-runtime";const i=`stroke-action forced-colors:stroke-[Highlight]`;function a({value:a,max:o=100,size:s=48,thickness:c,showValue:l=!1,className:u,style:d,children:f,...p}){let m=c??Math.max(2,Math.round(s*.09)),h=(s-m)/2,g=2*Math.PI*h,_=a===void 0,v=_?0:Math.min(Math.max(a,0),o),y=o>0?v/o:0,b={cx:s/2,cy:s/2,r:h,fill:`none`,strokeWidth:m},x=null;_?x=/* @__PURE__ */ r(t,{children:[/* @__PURE__ */ n(`circle`,{...b,className:e(`origin-center animate-spin motion-reduce:hidden`,i),strokeDasharray:`${g/4} ${g}`}),/* @__PURE__ */ n(`circle`,{...b,className:e(`hidden motion-reduce:block`,i),strokeDasharray:`${m} ${m*2}`})]}):y>0&&(x=/* @__PURE__ */ n(`circle`,{...b,className:e(`transition-[stroke-dashoffset] duration-(--duration-base) ease-standard`,i),strokeDasharray:g,strokeDashoffset:g*(1-y)}));let S=null;return f===void 0?l&&!_&&(S=/* @__PURE__ */ n(`span`,{className:`relative font-tech leading-none font-bold tabular-nums`,style:{fontSize:Math.round(s*.3)},children:Math.round(y*100)})):S=/* @__PURE__ */ n(`span`,{className:`relative flex items-center justify-center`,children:f}),/* @__PURE__ */ r(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":_?void 0:v,...p,className:e(`relative inline-flex shrink-0 items-center justify-center text-ink`,u),style:{width:s,height:s,...d},children:[/* @__PURE__ */ r(`svg`,{width:s,height:s,viewBox:`0 0 ${s} ${s}`,"aria-hidden":`true`,className:`absolute inset-0 -rotate-90`,children:[/* @__PURE__ */ n(`circle`,{...b,className:`stroke-line forced-colors:stroke-[CanvasText] forced-colors:stroke-1`}),x]}),S]})}export{a as ProgressRing};
@@ -0,0 +1,4 @@
1
+
2
+ import { Progress, ProgressProps, ProgressSize } from "./Progress.js";
3
+ import { ProgressRing, ProgressRingProps } from "./ProgressRing.js";
4
+ export { Progress, type ProgressProps, ProgressRing, type ProgressRingProps, type ProgressSize };
@@ -0,0 +1,33 @@
1
+
2
+ import { ComponentProps, ReactNode } from "react";
3
+ //#region src/components/radio/Radio.d.ts
4
+ export type RadioGroupOrientation = "vertical" | "horizontal";
5
+ export type RadioGroupProps = Omit<ComponentProps<"div">, "onChange" | "defaultValue"> & {
6
+ /** 受控的当前值 */
7
+ value?: string;
8
+ /** 非受控时的初始值 */
9
+ defaultValue?: string;
10
+ onValueChange?: (value: string) => void;
11
+ /** 表单提交用的字段名,缺省自动生成 */
12
+ name?: string;
13
+ disabled?: boolean;
14
+ required?: boolean;
15
+ /** 竖排(默认)或横排 */
16
+ orientation?: RadioGroupOrientation;
17
+ };
18
+ /**
19
+ * 单选组。方向键在组内移动并选中,这是原生单选的行为,组件不另外处理。
20
+ * 标签用 `<Field group label="…">` 包住它,或者自己传 `aria-label`。
21
+ */
22
+ export declare function RadioGroup({ value, defaultValue, onValueChange, name, disabled: disabledProp, required: requiredProp, orientation, className, ...props }: RadioGroupProps): import("react").JSX.Element;
23
+ export type RadioProps = Omit<ComponentProps<"input">, "type" | "size" | "value"> & {
24
+ value: string;
25
+ /** 右侧的文字标签。不传时必须自己给 `aria-label` */
26
+ children?: ReactNode;
27
+ };
28
+ /**
29
+ * 单选框,放在 `RadioGroup` 里。`className` 给整行,其余属性与 `ref` 给 `<input>`。
30
+ * 脱离 `RadioGroup` 时就是一个原生单选,自己管 `name` 与 `checked`。
31
+ */
32
+ export declare function Radio({ value, disabled, onChange, className, children, ...props }: RadioProps): import("react").JSX.Element;
33
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{focusRing as t}from"../../lib/focus-ring.js";import{createLazyContext as n}from"../../lib/create-lazy-context.js";import{useControllableState as r}from"../../hooks/useControllableState.js";import{choiceBox as i,choiceControl as a,choiceFrame as o,choiceLabel as s,choiceMark as c}from"../checkbox/choice-style.js";import{useFieldContext as l}from"../field/Field.js";import{useContext as u,useId as d,useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h=/* @__PURE__ */ n(null);function g({value:t,defaultValue:n,onValueChange:i,name:a,disabled:o,required:s,orientation:c=`vertical`,className:u,...m}){let g=h(),_=l(),v=d(),[y,b]=r({value:t,defaultValue:n,onChange:e=>{e!==void 0&&i?.(e)}}),x=o??_?.disabled??!1,S=s??_?.required??!1,C=_?.invalid??!1,w=a??v,T=f(()=>({name:w,value:y,select:b,disabled:x,required:S,invalid:C}),[w,y,b,x,S,C]);return/* @__PURE__ */ p(g.Provider,{value:T,children:/* @__PURE__ */ p(`div`,{role:`radiogroup`,"aria-labelledby":_&&!_.group?_.labelId:void 0,"aria-describedby":_?.describedBy,"aria-invalid":C||void 0,"aria-required":S||void 0,"aria-disabled":x||void 0,...m,"data-orientation":c,className:e(`flex`,c===`vertical`?`flex-col`:`flex-wrap gap-x-6`,u)})})}function _({value:n,disabled:r,onChange:l,className:d,children:f,...g}){let _=u(h()),v=e=>{l?.(e),e.target.checked&&_?.select(n)},y=_?{name:_.name,checked:_.value===n,required:_.required,"aria-invalid":_.invalid||void 0}:{};return/* @__PURE__ */ m(`label`,{className:e(s,d),children:[/* @__PURE__ */ p(`span`,{className:a,children:/* @__PURE__ */ m(`span`,{className:o,children:[/* @__PURE__ */ p(`input`,{...g,...y,type:`radio`,value:n,disabled:r??_?.disabled,onChange:v,className:e(i,`rounded-full choice-diamond:rounded-none`,t)}),/* @__PURE__ */ p(`span`,{"aria-hidden":`true`,className:e(c,`size-2 rounded-full bg-accent-ink-inverse peer-checked:opacity-100 peer-disabled:bg-ink-disabled choice-diamond:hidden`,`forced-colors:bg-[HighlightText] forced-colors:peer-disabled:bg-[GrayText]`)})]})}),f!==void 0&&/* @__PURE__ */ p(`span`,{className:`min-w-0`,children:f})]})}export{_ as Radio,g as RadioGroup};
@@ -0,0 +1,3 @@
1
+
2
+ import { Radio, RadioGroup, RadioGroupOrientation, RadioGroupProps, RadioProps } from "./Radio.js";
3
+ export { Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps };
@@ -0,0 +1,16 @@
1
+
2
+ import { ComponentProps, ReactNode } from "react";
3
+ //#region src/components/rec-indicator/RecIndicator.d.ts
4
+ export type RecIndicatorProps = Omit<ComponentProps<"span">, "children"> & {
5
+ /** 方括号里的字,默认 `REC`;直播、实时数据可以写 `LIVE` */
6
+ label?: ReactNode;
7
+ /** 红点硬切明灭,默认开。关掉后红点常亮 */
8
+ blink?: boolean;
9
+ };
10
+ /**
11
+ * 录制指示:一个红点 + `[ REC ]`。
12
+ * 只在确有"进行中"的语义时用(正在录制、直播中、实时数据),不要当氛围装饰——
13
+ * 红色在这套语言里是危险与紧急。
14
+ */
15
+ export declare function RecIndicator({ label, blink, className, ...props }: RecIndicatorProps): import("react").JSX.Element;
16
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({label:r=`REC`,blink:i=!0,className:a,...o}){return/* @__PURE__ */ n(`span`,{...o,className:e(`inline-flex items-center gap-1 font-tech text-xs leading-none font-medium whitespace-nowrap text-ink uppercase`,a),children:[/* @__PURE__ */ t(`span`,{"aria-hidden":`true`,className:e(`mr-0.5 size-2 shrink-0 rounded-full bg-alert`,i&&`animate-blink`)}),/* @__PURE__ */ t(`span`,{"aria-hidden":`true`,className:`text-ink-tertiary`,children:`[`}),/* @__PURE__ */ t(`span`,{children:r}),/* @__PURE__ */ t(`span`,{"aria-hidden":`true`,className:`text-ink-tertiary`,children:`]`})]})}export{r as RecIndicator};
@@ -0,0 +1,3 @@
1
+
2
+ import { RecIndicator, RecIndicatorProps } from "./RecIndicator.js";
3
+ export { RecIndicator, type RecIndicatorProps };
@@ -0,0 +1,16 @@
1
+
2
+ import { ComponentProps } from "react";
3
+ //#region src/components/registration-strip/RegistrationStrip.d.ts
4
+ export type RegistrationStripOrientation = "horizontal" | "vertical";
5
+ export type RegistrationStripProps = Omit<ComponentProps<"div">, "children"> & {
6
+ /** 横条高 3px、每段 64px;竖条是三段 6 × 14px 叠放 */
7
+ orientation?: RegistrationStripOrientation;
8
+ /** 横条后面接一段灰线、撑满容器:用作名称下方的分隔线 */
9
+ rule?: boolean;
10
+ };
11
+ /**
12
+ * 注册色条:品红、青、黄三段的微条,印刷品语气的点缀。
13
+ * 纯装饰,不承担任何数据或状态含义;一个版块最多一处,离图表远一点。
14
+ */
15
+ export declare function RegistrationStrip({ orientation, rule, className, ...props }: RegistrationStripProps): import("react").JSX.Element;
16
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{decor as t}from"../../lib/decor.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=[`bg-reg-magenta`,`bg-reg-cyan`,`bg-reg-yellow`];function a({orientation:a=`horizontal`,rule:o=!1,className:s,...c}){let l=a===`vertical`;return/* @__PURE__ */ r(`div`,{...c,"aria-hidden":`true`,"data-orientation":a,className:e(t,l?`inline-flex flex-col`:[`flex h-[3px] max-w-full`,o&&`w-full`],s),children:[i.map(t=>/* @__PURE__ */ n(`span`,{className:e(t,l?`h-3.5 w-1.5`:`w-16 min-w-0`)},t)),o&&!l&&/* @__PURE__ */ n(`span`,{className:`min-w-0 flex-1 bg-line`})]})}export{a as RegistrationStrip};
@@ -0,0 +1,3 @@
1
+
2
+ import { RegistrationStrip, RegistrationStripOrientation, RegistrationStripProps } from "./RegistrationStrip.js";
3
+ export { RegistrationStrip, type RegistrationStripOrientation, type RegistrationStripProps };
@@ -0,0 +1,25 @@
1
+
2
+ import { ComponentProps } from "react";
3
+ //#region src/components/rolling-number/RollingNumber.d.ts
4
+ export type RollingNumberProps = Omit<ComponentProps<"span">, "children"> & {
5
+ /** 终值 */
6
+ value: number;
7
+ /**
8
+ * 把数值写成字。默认带千分位(`1,280`),小数位数跟着 `value`。
9
+ * 滚的过程中每一帧都会调它
10
+ */
11
+ format?: (value: number) => string;
12
+ /** 进入视口时从 0 滚到终值,一次。默认开启 */
13
+ animate?: boolean;
14
+ };
15
+ /**
16
+ * 滚动数字:进入视口时从 0 滚到终值,只滚一次。放进 `Stat` 的 `value` 里,
17
+ * 或者任何"一个需要被一眼看到的数字"的地方。等宽数字由所在处给(`tabular-nums`)。
18
+ *
19
+ * - 读屏只读终值:终值一直在,滚的时候只是看不见;滚动的那一份对读屏隐藏。
20
+ * - 宽度由终值占着,滚的时候旁边的东西不动。
21
+ * - 服务端渲染出来的、打印出来的、"减少动态效果"下的,都直接是终值。
22
+ * - 值后来变了直接换,不再滚。
23
+ */
24
+ export declare function RollingNumber({ value, format, animate, className, ref, ...props }: RollingNumberProps): import("react").JSX.Element;
25
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{mergeRefs as t}from"../../lib/merge-refs.js";import{useInView as n}from"../../hooks/useInView.js";import{useReducedMotion as r}from"../../hooks/useReducedMotion.js";import{useEffect as i,useState as a,useSyncExternalStore as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(e){if(!e)return 600;let t=getComputedStyle(e).getPropertyValue(`--duration-slower`),n=Number.parseFloat(t);return!Number.isFinite(n)||n<=0?600:t.trim().endsWith(`ms`)?n:n*1e3}const u=e=>1-(1-e)**3;function d(e){let t=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:20,useGrouping:!1}).format(e).split(`.`)[1];return t?t.length:0}const f=()=>()=>{};function p({value:p,format:m,animate:h=!0,className:g,ref:_,...v}){let y=d(p),b=m??(e=>e.toLocaleString(`en-US`,{minimumFractionDigits:y,maximumFractionDigits:y})),x=o(f,()=>!0,()=>!1),S=r(),[C,w]=a(!1),[T,E]=a(0),D=x&&h&&!S&&!C,[O,k]=n({disabled:!D});return i(()=>{if(!D||!k)return;let e=l(O.current),t,n=requestAnimationFrame(function r(i){t??=i;let a=Math.min((i-t)/e,1);a>=1?w(!0):(E(Number((p*u(a)).toFixed(y))),n=requestAnimationFrame(r))});return()=>cancelAnimationFrame(n)},[D,k,O,p,y]),/* @__PURE__ */ c(`span`,{...v,ref:t(O,_),"data-rolling":D?``:void 0,className:e(D&&`relative inline-block`,g),children:[/* @__PURE__ */ s(`span`,{className:D?`opacity-0 print:opacity-100`:void 0,children:b(p)}),D&&/* @__PURE__ */ s(`span`,{"aria-hidden":`true`,className:`absolute inset-0 print:hidden`,children:b(T)})]})}export{p as RollingNumber};
@@ -0,0 +1,3 @@
1
+
2
+ import { RollingNumber, RollingNumberProps } from "./RollingNumber.js";
3
+ export { RollingNumber, type RollingNumberProps };
@@ -0,0 +1,78 @@
1
+
2
+ import { LinkRender } from "../link-element/LinkElement.js";
3
+ import { ComponentProps, MouseEvent, ReactNode } from "react";
4
+ //#region src/components/schedule/Schedule.d.ts
5
+ export type ScheduleProps = Omit<ComponentProps<"div">, "aria-label"> & {
6
+ /** 这张排期的名称。横向能滚动时,滚动的那一块用它 */
7
+ label: string;
8
+ /** 第一天,`YYYY-MM-DD` */
9
+ start: string;
10
+ /** 最后一天(包含) */
11
+ end: string;
12
+ /**
13
+ * 哪几天是日期锚:压在轴条上的日期块,往下带一条引线。
14
+ * 默认是第一天和范围内每个月的 1 号
15
+ */
16
+ anchors?: readonly string[];
17
+ /** 今天:画一条竖线。不传就不画 */
18
+ today?: string;
19
+ /** 一天至少多宽,像素。默认 32。容器够宽时各列平分多出来的宽度 */
20
+ dayWidth?: number;
21
+ /** 读屏听到的日期按它写。默认 `zh-CN` */
22
+ locale?: string;
23
+ /**
24
+ * 读屏听到的起止日期怎么说。默认"10月3日至10月12日",只有一天时是"10月5日"。
25
+ * 换了 `locale` 一般也要换它
26
+ */
27
+ describeRange?: (start: string, end: string) => string;
28
+ /** `ScheduleTrack` */
29
+ children?: ReactNode;
30
+ };
31
+ /**
32
+ * 排期:横向的时间轨图。条目从起始日的位置开始,长度就是持续时间。
33
+ * 最小单位是天。放不下时在自己的容器里横向滚动。
34
+ */
35
+ export declare function Schedule({ label, start, end, anchors: anchorsProp, today, dayWidth, locale, describeRange, className, style, children, ...props }: ScheduleProps): import("react").JSX.Element;
36
+ export type ScheduleTrackProps = Omit<ComponentProps<"section">, "aria-label"> & {
37
+ /** 类目的名称:竖轨上的字,也是这条轨的可访问名称 */
38
+ label: string;
39
+ /** 竖轨上的图标 */
40
+ icon?: ReactNode;
41
+ /** 直接放 `ScheduleItem` */
42
+ children?: ReactNode;
43
+ };
44
+ /**
45
+ * 一条轨:一个类目的条目排在一行里,时间重叠的自动错到下一行。
46
+ * 竖轨的颜色用 `className="[--track-color:…] [--track-ink:…]"` 换。
47
+ */
48
+ export declare function ScheduleTrack({ label, icon, className, children, ...props }: ScheduleTrackProps): import("react").JSX.Element;
49
+ export type ScheduleItemVariant = "banner" | "system";
50
+ type ItemOwnProps = {
51
+ /** 第一天,`YYYY-MM-DD` */
52
+ start: string;
53
+ /** 最后一天(包含) */
54
+ end: string;
55
+ /** 名称 */
56
+ title: ReactNode;
57
+ /** 类型小标签:右上角的白底描边小块。只有 `banner` 有 */
58
+ type?: ReactNode;
59
+ /**
60
+ * - `banner` 活动:浅底,可以垫一张图,左上是墨色的名称块,默认;
61
+ * - `system` 系统类:炭灰底 + 行动色侧签 + 一条虚线,不带图。
62
+ */
63
+ variant?: ScheduleItemVariant;
64
+ /** 垫在条目下面的图,铺满并裁切。只有 `banner` 有 */
65
+ media?: ReactNode;
66
+ /** 传了名称就是一个链接,点击范围铺满整个条目 */
67
+ href?: string;
68
+ target?: string;
69
+ rel?: string;
70
+ /** 用这个元素代替 `<a>`(路由库的链接组件)。传了就按链接处理 */
71
+ render?: LinkRender;
72
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
73
+ };
74
+ export type ScheduleItemProps = ItemOwnProps & Omit<ComponentProps<"li">, keyof ItemOwnProps | "children">;
75
+ /** 排期里的一个条目。直接放在 `ScheduleTrack` 里。 */
76
+ export declare function ScheduleItem({ start, end, title, type, variant, media, href, target, rel, render, onClick, className, style, ...props }: ScheduleItemProps): import("react").JSX.Element | null;
77
+ //#endregion
78
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{focusRingInset as t}from"../../lib/focus-ring.js";import{createLazyContext as n}from"../../lib/create-lazy-context.js";import{LinkElement as r}from"../link-element/LinkElement.js";import{dateParts as i,daysBetween as a,eachDay as o,toDateObject as s}from"../../lib/date.js";import{decor as c}from"../../lib/decor.js";import{Tag as l}from"../tag/Tag.js";import{useOverflowing as u}from"../../hooks/useOverflowing.js";import{useContext as d,useMemo as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g=/* @__PURE__ */ n(null);function _(e){let t=d(g());if(!t)throw Error(`${e} 要放在 Schedule 里面`);return t}const v=e=>String(e).padStart(2,`0`),y=`grid grid-cols-[repeat(var(--schedule-days),minmax(var(--schedule-day),1fr))]`,b=`w-12`,x=`left-12`;function S({label:n,start:r,end:d,anchors:p,today:_,dayWidth:S=32,locale:C=`zh-CN`,describeRange:w,className:T,style:E,children:D,...O}){let k=g(),[A,j]=u(),M=f(()=>o(r,d),[r,d]),N=M.length,P=f(()=>new Set(p??M.filter((e,t)=>t===0||i(e).day===1)),[p,M]),F=f(()=>{let e=new Intl.DateTimeFormat(C,{timeZone:`UTC`,month:`long`,day:`numeric`}),t=t=>e.format(s(t));return{start:r,days:N,describe:w??((e,n)=>e===n?t(e):`${t(e)}至${t(n)}`)}},[r,N,C,w]),I=e=>a(r,e)+1,L=_!==void 0&&_>=r&&_<=d?I(_):null;return/* @__PURE__ */ m(k.Provider,{value:F,children:/* @__PURE__ */ m(`div`,{ref:A,...O,"data-overflowing":j.x?``:void 0,...j.x&&{role:`region`,"aria-label":n,tabIndex:0},style:{"--schedule-days":N,"--schedule-day":`${S}px`,...E},className:e(`isolate overflow-x-auto text-ink [--schedule-surface:var(--ef-surface)]`,t,T),children:/* @__PURE__ */ h(`div`,{role:j.x?void 0:`group`,"aria-label":j.x?void 0:n,className:`relative w-[calc(3rem+var(--schedule-days)*var(--schedule-day))] min-w-full`,children:[/* @__PURE__ */ m(`div`,{"aria-hidden":`true`,className:e(c,`absolute inset-y-0 right-0 bg-surface-sunken hatch`,x)}),/* @__PURE__ */ m(`div`,{"aria-hidden":`true`,className:e(c,`absolute inset-y-0 right-0`,x,y),children:[...P].map(e=>/* @__PURE__ */ m(`span`,{style:{gridColumn:I(e)},className:`row-start-1 border-l border-dashed border-line-strong`},e))}),/* @__PURE__ */ h(`div`,{"aria-hidden":`true`,className:`relative flex`,children:[/* @__PURE__ */ m(`div`,{className:e(`sticky left-0 z-3 shrink-0 bg-(--schedule-surface)`,b)}),/* @__PURE__ */ m(`div`,{className:e(`h-8 flex-1 items-center bg-surface-muted`,y),children:M.map((e,t)=>{if(P.has(e)){let{month:t,day:n}=i(e);return/* @__PURE__ */ m(l,{variant:`inverse`,size:`sm`,numeric:!0,marked:!0,"data-anchor":e,className:`z-1 justify-self-start`,children:`${v(t)}.${v(n)}`},e)}let n=t>0&&P.has(M[t-1]);return/* @__PURE__ */ m(`span`,{className:`text-center font-tech text-micro text-ink-tertiary tabular-nums`,children:n?null:i(e).day},e)})})]}),/* @__PURE__ */ m(`div`,{className:`relative flex flex-col gap-1 pt-1`,children:D}),L!==null&&/* @__PURE__ */ m(`div`,{"aria-hidden":`true`,className:e(`pointer-events-none absolute inset-y-0 right-0 z-2 select-none print:hidden`,x,y),children:/* @__PURE__ */ m(`span`,{"data-today":``,style:{gridColumn:L},className:`row-start-1 border-l-2 border-accent-ink forced-colors:border-[Highlight]`})})]})})})}function C({label:t,icon:n,className:r,children:i,...a}){return _(`ScheduleTrack`),/* @__PURE__ */ h(`section`,{...a,"aria-label":t,className:e(`flex [--track-color:var(--ef-surface-inverse)] [--track-ink:var(--ef-ink-inverse)]`,r),children:[/* @__PURE__ */ h(`div`,{"aria-hidden":`true`,className:e(`sticky left-0 z-3 flex shrink-0 flex-col items-center gap-2 bg-(--track-color) py-2 text-(--track-ink)`,`border-r-4 border-(--schedule-surface)`,b),children:[n&&/* @__PURE__ */ m(`span`,{className:`flex size-4 shrink-0 items-center justify-center [&_svg]:size-4`,children:n}),/* @__PURE__ */ m(`span`,{className:`text-xs leading-none font-medium tracking-label [writing-mode:vertical-rl]`,children:t})]}),/* @__PURE__ */ m(`ul`,{className:e(`min-h-12 flex-1 grid-flow-row-dense auto-rows-[3rem] gap-y-1`,y),children:i})]})}function w({start:t,end:n,title:i,type:o,variant:s=`banner`,media:c,href:u,target:d,rel:f,render:g,onClick:v,className:y,style:b,...x}){let S=_(`ScheduleItem`),C=a(S.start,t),w=a(S.start,n);if(w<0||C>=S.days||w<C)return null;let T=Math.max(C,0)+1,E=Math.min(w,S.days-1)+2,D=u!==void 0||g!==void 0,O=s===`banner`,k=D?/* @__PURE__ */ m(r,{render:g,href:u,target:d,rel:f,onClick:v,className:`outline-none after:absolute after:inset-0 after:content-['']`,children:i}):i;return/* @__PURE__ */ h(`li`,{...x,"data-variant":s,"data-clipped-start":C<0?``:void 0,"data-clipped-end":w>=S.days?``:void 0,style:{gridColumn:`${T} / ${E}`,...b},className:e(`@container relative isolate flex min-w-0 overflow-clip text-sm`,`has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-focus`,`forced-colors:border forced-colors:border-[CanvasText]`,O?`items-start justify-between gap-2 bg-surface-muted p-2`:`items-center gap-2 bg-control pr-2 text-on-control`,y),children:[O?/* @__PURE__ */ h(p,{children:[c&&/* @__PURE__ */ m(`div`,{"aria-hidden":`true`,className:`absolute inset-0 -z-10 *:size-full *:object-cover`,children:c}),/* @__PURE__ */ m(`span`,{className:`flex h-6 max-w-full min-w-0 items-center bg-surface-inverse px-2 font-medium text-ink-inverse`,children:/* @__PURE__ */ m(`span`,{className:`truncate`,children:k})}),o&&/* @__PURE__ */ m(l,{variant:`outline`,size:`sm`,className:`@max-[10rem]:hidden`,children:o})]}):/* @__PURE__ */ h(p,{children:[/* @__PURE__ */ m(`span`,{"aria-hidden":`true`,className:`w-1.5 shrink-0 self-stretch bg-action`}),/* @__PURE__ */ m(`span`,{className:`min-w-0 truncate font-medium`,children:k}),/* @__PURE__ */ m(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1 border-t border-dashed border-action`})]}),/* @__PURE__ */ m(`span`,{className:`sr-only`,children:`,${S.describe(t,n)}`})]})}export{S as Schedule,w as ScheduleItem,C as ScheduleTrack};
@@ -0,0 +1,3 @@
1
+
2
+ import { Schedule, ScheduleItem, ScheduleItemProps, ScheduleItemVariant, ScheduleProps, ScheduleTrack, ScheduleTrackProps } from "./Schedule.js";
3
+ export { Schedule, ScheduleItem, type ScheduleItemProps, type ScheduleItemVariant, type ScheduleProps, ScheduleTrack, type ScheduleTrackProps };
@@ -0,0 +1,26 @@
1
+
2
+ import { CSSProperties, ComponentProps, Ref } from "react";
3
+ //#region src/components/scroll-area/ScrollArea.d.ts
4
+ export type ScrollAreaOrientation = "vertical" | "horizontal" | "both";
5
+ export type ScrollAreaProps = Omit<ComponentProps<"div">, "aria-label" | "className" | "style" | "ref"> & {
6
+ /** 这一块是什么。能滚的时候它是一个能聚焦的区域,读屏听到的就是这个名称 */
7
+ "aria-label": string;
8
+ /** 哪个方向能滚,默认 `vertical`。只管一个方向时,另一个方向滚不了 */
9
+ orientation?: ScrollAreaOrientation;
10
+ /** 真正在滚的那个元素:给页内目录、回到顶部的 `target` */
11
+ viewportRef?: Ref<HTMLDivElement>;
12
+ /** 给外框:高度或者高度上限写在这里 */
13
+ className?: string;
14
+ style?: CSSProperties;
15
+ /** 给外框 */
16
+ ref?: Ref<HTMLDivElement>;
17
+ };
18
+ /**
19
+ * 滚动区:一块自己能滚的区域,滚动条是画出来的。高度(或高度上限)由 `className` 给。
20
+ * 只有真的溢出时才有滚动条,也才是一个能聚焦的区域。
21
+ *
22
+ * 整页的滚动留给浏览器,不要把页面主体包进来。
23
+ * `className` 与 `ref` 给外框,其余属性(`onScroll` 等)给真正在滚的可视区。
24
+ */
25
+ export declare function ScrollArea({ "aria-label": label, orientation, viewportRef, className, style, ref, children, ...props }: ScrollAreaProps): import("react").JSX.Element;
26
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{focusRingInset as t}from"../../lib/focus-ring.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{ScrollArea as i}from"@base-ui/react/scroll-area";const a={vertical:`w-3 before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-line`,horizontal:`h-3 before:absolute before:inset-x-0 before:top-1/2 before:h-px before:-translate-y-1/2 before:bg-line`},o={vertical:`w-full before:inset-y-0 before:left-1/2 before:w-[3px] before:-translate-x-1/2`,horizontal:`h-full before:inset-x-0 before:top-1/2 before:h-[3px] before:-translate-y-1/2`};function s({orientation:t}){return/* @__PURE__ */ n(i.Scrollbar,{orientation:t,className:e(`group/bar flex`,a[t]),children:/* @__PURE__ */ n(i.Thumb,{className:e(`relative before:absolute before:bg-ink-secondary before:content-['']`,`before:transition-colors before:duration-(--duration-fast) before:ease-standard`,`group-hover/bar:before:bg-ink active:before:bg-ink`,`forced-colors:before:bg-[CanvasText]`,o[t])})})}function c({"aria-label":a,orientation:o=`vertical`,viewportRef:c,className:l,style:u,ref:d,children:f,...p}){let m=o!==`horizontal`,h=o!==`vertical`;return/* @__PURE__ */ r(i.Root,{ref:d,style:u,"data-scroll-area":``,"data-orientation":o,className:e(`flex min-h-0 min-w-0 flex-col text-ink`,l),children:[/* @__PURE__ */ n(i.Viewport,{...p,ref:c,style:o===`vertical`?{overflowX:`hidden`}:o===`horizontal`?{overflowY:`hidden`}:void 0,className:e(`min-h-0 flex-auto`,t,m&&`data-has-overflow-y:mr-3`,h&&`data-has-overflow-x:mb-3`),render:(e,t)=>{let r=m&&t.hasOverflowY||h&&t.hasOverflowX;return/* @__PURE__ */ n(`div`,{...e,...r&&{role:`region`,"aria-label":a},tabIndex:r?0:-1})},children:/* @__PURE__ */ n(i.Content,{children:f})}),m&&/* @__PURE__ */ n(s,{orientation:`vertical`}),h&&/* @__PURE__ */ n(s,{orientation:`horizontal`}),o===`both`&&/* @__PURE__ */ n(i.Corner,{})]})}export{c as ScrollArea};
@@ -0,0 +1,3 @@
1
+
2
+ import { ScrollArea, ScrollAreaOrientation, ScrollAreaProps } from "./ScrollArea.js";
3
+ export { ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps };
@@ -0,0 +1,23 @@
1
+
2
+ import { ComponentProps, ReactNode, RefObject } from "react";
3
+ //#region src/components/scroll-hint/ScrollHint.d.ts
4
+ export type ScrollHintVariant = "line" | "chevron";
5
+ export type ScrollHintProps = Omit<ComponentProps<"div">, "children"> & {
6
+ /** 上方的小字,默认 `SCROLL` */
7
+ label?: ReactNode;
8
+ /**
9
+ * - `line` 一条细竖线 + 一个下坠的光点,默认;
10
+ * - `chevron` 一个下坠的折线箭头,窄屏用。
11
+ */
12
+ variant?: ScrollHintVariant;
13
+ /** 看哪个滚动容器。不传就是整个页面 */
14
+ target?: RefObject<HTMLElement | null>;
15
+ /** 滚过多少像素算"已经开始滚动",默认 8 */
16
+ threshold?: number;
17
+ };
18
+ /**
19
+ * 滚动提示:只在确实还能往下滚、并且还没开始滚的时候出现,滚动开始后淡出。
20
+ * 纯装饰,对读屏隐藏;位置由使用方定(首屏底部居中或右下)。
21
+ */
22
+ export declare function ScrollHint({ label, variant, target, threshold, className, ...props }: ScrollHintProps): import("react").JSX.Element;
23
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{ChevronDown as t}from"../../icons/ChevronDown.js";import{useScrollPosition as n}from"../../hooks/useScrollPosition.js";import{useCallback as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({label:o=`SCROLL`,variant:s=`line`,target:c,threshold:l=8,className:u,...d}){let f=r(({scrolled:e,room:t})=>t>l&&e<=l,[l]),p=n(c,f,!1);return/* @__PURE__ */ a(`div`,{"aria-hidden":`true`,...d,"data-visible":p?``:void 0,className:e(`pointer-events-none inline-flex flex-col items-center gap-2 text-ink-secondary`,`transition-opacity duration-(--duration-base) ease-standard`,p?`opacity-100`:`opacity-0`,u),children:[/* @__PURE__ */ i(`span`,{className:`font-tech text-micro tracking-label uppercase`,children:o}),s===`line`?/* @__PURE__ */ i(`span`,{className:`relative h-10 w-px bg-line-strong`,children:/* @__PURE__ */ i(`span`,{className:`absolute top-0 -left-[2.5px] size-1.5 animate-scroll-hint rounded-full bg-accent-ink`})}):/* @__PURE__ */ i(t,{size:16,className:`animate-scroll-hint text-accent-ink`})]})}export{o as ScrollHint};
@@ -0,0 +1,3 @@
1
+
2
+ import { ScrollHint, ScrollHintProps, ScrollHintVariant } from "./ScrollHint.js";
3
+ export { ScrollHint, type ScrollHintProps, type ScrollHintVariant };
@@ -0,0 +1,33 @@
1
+
2
+ import { ComponentProps, ReactNode } from "react";
3
+ //#region src/components/section-title/SectionTitle.d.ts
4
+ export type SectionTitleVariant = "standard" | "plain" | "band" | "side";
5
+ export type SectionTitleProps = Omit<ComponentProps<"header">, "title"> & {
6
+ /**
7
+ * - `standard` 灰色滑块 + 斜箭头 + 英文,下接中文。版块的第一级标题,默认;
8
+ * - `plain` 只留标题和左侧一条短竖条。文档、设置这类工具页面;
9
+ * - `band` 通栏信号黄色带。亮暗版块之间的过渡,一页最多一到两条;
10
+ * - `side` 竖排侧签。贴在横向展开的版块左缘,窄屏下回到横排。
11
+ */
12
+ variant?: SectionTitleVariant;
13
+ /** 真正的标题文字 */
14
+ children: ReactNode;
15
+ /** 英文结构层:`standard` 的栏目名、`side` 的大字。写真实的栏目名 */
16
+ latin?: ReactNode;
17
+ /** `band` 主题上方的小号副题 */
18
+ subtitle?: ReactNode;
19
+ /** `standard` 顶部的微文字行,如 `// 新闻 2026.10.08` */
20
+ meta?: ReactNode;
21
+ /** 标题层级,默认 2(`<h2>`) */
22
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
23
+ /** `standard` 进入视口时播放一次入场,默认开启 */
24
+ animate?: boolean;
25
+ /** 英文只是标题的翻译时对读屏隐藏,避免重复朗读。默认隐藏 */
26
+ latinHidden?: boolean;
27
+ /** `side` 的底色:`accent` 信号黄,`muted` 浅灰 */
28
+ tone?: "accent" | "muted";
29
+ /** `band` 与 `side` 的线稿插图位,纯装饰 */
30
+ illustration?: ReactNode;
31
+ };
32
+ export declare function SectionTitle({ variant, children, latin, subtitle, meta, level, animate, latinHidden, tone, illustration, className, ref: forwardedRef, ...props }: SectionTitleProps): import("react").JSX.Element;
33
+ //#endregion
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{useInView as t}from"../../hooks/useInView.js";import{ArrowCorner as n}from"../../icons/ArrowCorner.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({variant:a=`standard`,children:o,latin:s,subtitle:c,meta:l,level:u=2,animate:d=!0,latinHidden:f=!0,tone:p=`accent`,illustration:m,className:h,ref:g,..._}){let v=`h${u}`,y=a===`standard`&&d,[b,x]=t({disabled:!y}),S=e=>{b.current=e,typeof g==`function`?g(e):g&&(g.current=e)};if(a===`plain`)return/* @__PURE__ */ i(`header`,{..._,ref:S,className:e(`flex items-center gap-3`,h),children:[/* @__PURE__ */ r(`span`,{"aria-hidden":`true`,className:`h-6 w-1 shrink-0 bg-ink`}),/* @__PURE__ */ r(v,{className:`min-w-0 text-2xl font-bold wrap-anywhere text-ink`,children:o})]});if(a===`band`)return/* @__PURE__ */ r(`header`,{..._,ref:S,className:e(`@container bg-action text-on-action`,h),children:/* @__PURE__ */ i(`div`,{className:`flex min-h-16 items-center gap-4 px-4 py-4 @md:min-h-24 @md:gap-6 @md:px-10`,children:[m&&/* @__PURE__ */ r(`div`,{"aria-hidden":`true`,className:`hidden shrink-0 @sm:block`,children:m}),/* @__PURE__ */ i(`div`,{className:`min-w-0`,children:[c&&/* @__PURE__ */ r(`p`,{className:`font-latin text-base leading-tight font-light wrap-anywhere uppercase @md:text-lg`,children:c}),/* @__PURE__ */ r(v,{className:`font-latin text-xl font-medium wrap-anywhere uppercase @xs:text-2xl @md:text-3xl`,children:o})]})]})});if(a===`side`)return/* @__PURE__ */ i(`header`,{..._,ref:S,className:e(`flex flex-wrap items-center gap-3 px-4 py-3`,`md:self-stretch md:px-3 md:py-6 md:[writing-mode:vertical-rl]`,p===`accent`?`bg-action text-on-action`:`bg-surface-muted text-ink`,h),children:[m&&/* @__PURE__ */ r(`div`,{"aria-hidden":`true`,className:`shrink-0`,children:m}),/* @__PURE__ */ r(v,{className:`text-sm font-medium`,children:o}),s&&/* @__PURE__ */ r(`p`,{"aria-hidden":f||void 0,className:`max-w-full font-latin text-2xl font-medium wrap-anywhere uppercase`,children:s})]});let C=y&&!x,w=y&&x;return/* @__PURE__ */ i(`header`,{..._,ref:S,className:h,children:[l&&/* @__PURE__ */ r(`p`,{className:e(`mb-2 font-tech text-xs text-ink-secondary`,C&&`opacity-0`,w&&`animate-fade-in [animation-delay:200ms]`),children:l}),/* @__PURE__ */ i(`div`,{className:`flex flex-wrap items-center gap-x-2`,children:[/* @__PURE__ */ r(`span`,{"aria-hidden":`true`,className:`relative block h-8 w-26 shrink-0 overflow-hidden`,children:/* @__PURE__ */ r(`span`,{className:e(`absolute inset-0 flex items-center justify-end bg-neutral-300 pr-1.5 text-neutral-900`,C&&`-translate-x-full`,w&&`animate-slide-in`),children:/* @__PURE__ */ r(n,{size:20,className:e(C&&`-rotate-45`,w&&`animate-turn-in [animation-delay:100ms]`)})})}),s&&/* @__PURE__ */ r(`p`,{"aria-hidden":f||void 0,className:e(`max-w-full font-latin text-xl leading-8 font-medium wrap-anywhere text-ink uppercase`,C&&`opacity-0`,w&&`animate-fade-in [animation-delay:200ms]`),children:s})]}),/* @__PURE__ */ r(v,{className:e(`mt-1 text-2xl font-bold wrap-anywhere text-ink`,C&&`opacity-0`,w&&`animate-fade-in [animation-delay:200ms]`),children:o})]})}export{a as SectionTitle};
@@ -0,0 +1,3 @@
1
+
2
+ import { SectionTitle, SectionTitleProps, SectionTitleVariant } from "./SectionTitle.js";
3
+ export { SectionTitle, type SectionTitleProps, type SectionTitleVariant };
@@ -0,0 +1,49 @@
1
+
2
+ import { ControlSize, ControlVariant } from "../input/control-box.js";
3
+ import { ComponentProps, ReactNode } from "react";
4
+ //#region src/components/segmented-control/SegmentedControl.d.ts
5
+ export type SegmentedControlSize = ControlSize;
6
+ export type SegmentedControlVariant = ControlVariant;
7
+ export type SegmentedControlProps = Omit<ComponentProps<"div">, "onChange" | "defaultValue"> & {
8
+ /** 受控的当前值 */
9
+ value?: string;
10
+ /** 非受控时的初始值 */
11
+ defaultValue?: string;
12
+ onValueChange?: (value: string) => void;
13
+ /** 表单字段名:选中的值会随表单提交。缺省自动生成 */
14
+ name?: string;
15
+ /** 32 / 40 / 56px 高,和输入框同三档 */
16
+ size?: SegmentedControlSize;
17
+ /**
18
+ * 轨道的画法,和输入框相同:
19
+ * - `sunken` 凹陷的底 + 一条底边线,默认;
20
+ * - `outline` 四边描边,放在凹陷底色的区域里时用。
21
+ */
22
+ variant?: SegmentedControlVariant;
23
+ disabled?: boolean;
24
+ required?: boolean;
25
+ /** 错误态。放在 `Field` 里时跟随它的 `error` */
26
+ invalid?: boolean;
27
+ };
28
+ /**
29
+ * 分段选择:两到五个值里选一个,选项并排摆在一条轨道里。
30
+ * 语义是单选组——方向键换值,带 `name` 时随表单提交。里面只放 `Segment`。
31
+ * 标签用 `Field` 包住它,或者自己传 `aria-label`。
32
+ *
33
+ * 切换的是下面显示哪一块内容时用 `Tabs`,不是它。
34
+ */
35
+ export declare function SegmentedControl({ value, defaultValue, onValueChange, name, size, variant, disabled: disabledProp, required: requiredProp, invalid: invalidProp, className, ref, ...props }: SegmentedControlProps): import("react").JSX.Element;
36
+ type SegmentOwnProps = {
37
+ value: string;
38
+ /** 文字左边的图标。只有图标时要给 `aria-label` */
39
+ icon?: ReactNode;
40
+ disabled?: boolean;
41
+ /** 这一段的可访问名称;不传就是里面的文字 */
42
+ "aria-label"?: string;
43
+ children?: ReactNode;
44
+ };
45
+ export type SegmentProps = SegmentOwnProps & Omit<ComponentProps<"label">, keyof SegmentOwnProps>;
46
+ /** 分段选择里的一段。`className` 给这一段的外壳。 */
47
+ export declare function Segment({ value, icon, disabled: disabledProp, "aria-label": ariaLabel, className, children, ...props }: SegmentProps): import("react").JSX.Element;
48
+ //#endregion
49
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{cn as e}from"../../lib/cn.js";import{createLazyContext as t}from"../../lib/create-lazy-context.js";import{mergeRefs as n}from"../../lib/merge-refs.js";import{useControllableState as r}from"../../hooks/useControllableState.js";import{indicator as i,indicatorBox as a}from"../../lib/motion.js";import{useFieldContext as o}from"../field/Field.js";import{controlLine as s,controlSize as c}from"../input/control-box.js";import{useIndicator as l}from"../../hooks/useIndicator.js";import{useContext as u,useId as d,useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h=/* @__PURE__ */ t(null),g={sunken:`border-b-2 bg-surface-sunken`,outline:`border bg-surface`};function _({value:t,defaultValue:u,onValueChange:m,name:_,size:v=`md`,variant:y=`sunken`,disabled:b,required:x,invalid:S,className:C,ref:w,...T}){let E=h(),D=o(),O=l(`[data-selected]`),k=d(),[A,j]=r({value:t,defaultValue:u,onChange:e=>{e!==void 0&&m?.(e)}}),M=b??D?.disabled??!1,N=x??D?.required??!1,P=S??D?.invalid??!1,F=_??k,I=f(()=>({name:F,value:A,select:j,size:v,disabled:M,required:N,invalid:P}),[F,A,j,v,M,N,P]);return/* @__PURE__ */ p(E.Provider,{value:I,children:/* @__PURE__ */ p(`div`,{role:`radiogroup`,"aria-labelledby":D&&!D.group?D.labelId:void 0,"aria-describedby":D?.describedBy,"aria-invalid":P||void 0,"aria-required":N||void 0,"aria-disabled":M||void 0,...T,ref:n(O,w),"data-variant":y,"data-size":v,className:e(`inline-grid max-w-full auto-cols-fr grid-flow-col p-0.5 text-ink`,`transition-colors duration-(--duration-fast) ease-standard`,i,a,`after:bg-surface-inverse has-[[data-selected][data-disabled]]:after:bg-disabled`,`forced-colors:after:bg-[Highlight] forced-colors:has-[[data-selected][data-disabled]]:after:bg-[GrayText]`,g[y],c[v],M?`border-line`:P?`border-danger`:[`border-line-strong`,s(y)],C)})})}const v={sm:`gap-1.5 px-3 [&_svg]:size-3.5`,md:`gap-2 px-4 [&_svg]:size-4`,lg:`gap-2.5 px-6 [&_svg]:size-5`};function y({value:t,icon:n,disabled:r,"aria-label":i,className:a,children:o,...s}){let c=u(h());if(!c)throw Error(`<Segment> 必须放在 <SegmentedControl> 里`);let l=c.value===t,d=r??c.disabled;return/* @__PURE__ */ m(`label`,{...s,"data-selected":l?``:void 0,"data-disabled":d?``:void 0,className:e(`relative flex min-w-0 items-center justify-center font-medium whitespace-nowrap select-none`,`transition-colors duration-(--duration-fast) ease-standard`,`has-focus-visible:z-1 has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-focus`,v[c.size],d?`cursor-not-allowed`:`cursor-pointer`,l?[d?`bg-disabled text-on-disabled forced-colors:bg-[GrayText] forced-colors:text-[Canvas]`:`bg-surface-inverse text-ink-inverse forced-colors:bg-[Highlight] forced-colors:text-[HighlightText]`,`in-data-indicator:bg-transparent forced-colors:in-data-indicator:bg-transparent`,`forced-colors:forced-color-adjust-none forced-colors:has-focus-visible:outline-[Highlight]`]:d?`text-ink-disabled forced-colors:text-[GrayText]`:`text-ink-secondary hover:bg-ink/5 hover:text-ink`,a),children:[/* @__PURE__ */ p(`input`,{type:`radio`,name:c.name,value:t,checked:l,disabled:d,required:c.required,"aria-label":i,"aria-invalid":c.invalid||void 0,onChange:()=>c.select(t),className:`absolute inset-0 size-full cursor-[inherit] appearance-none outline-none`}),n,o!==void 0&&/* @__PURE__ */ p(`span`,{className:`pointer-events-none min-w-0 truncate`,children:o})]})}export{y as Segment,_ as SegmentedControl};
@@ -0,0 +1,3 @@
1
+
2
+ import { Segment, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedControlSize, SegmentedControlVariant } from "./SegmentedControl.js";
3
+ export { Segment, type SegmentProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedControlVariant };