datocms-react-ui 3.1.0-next.5 → 4.0.0-next.7

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 (577) hide show
  1. package/README.md +2 -1
  2. package/dist/DateInput.d.ts +2 -0
  3. package/dist/DateInput.js +2 -0
  4. package/dist/DateTimeInput.d.ts +2 -0
  5. package/dist/DateTimeInput.js +2 -0
  6. package/dist/DateTimeRangeInput.d.ts +2 -0
  7. package/dist/DateTimeRangeInput.js +2 -0
  8. package/dist/FilterBuilder.d.ts +2 -0
  9. package/dist/FilterBuilder.js +2 -0
  10. package/dist/LICENSE-lucide.txt +43 -0
  11. package/dist/RecordRow.d.ts +2 -0
  12. package/dist/RecordRow.js +2 -0
  13. package/dist/UploadCard.js +2 -2
  14. package/dist/UploadPreview.d.ts +2 -2
  15. package/dist/UploadPreview.js +1 -1
  16. package/dist/UserRow.d.ts +2 -0
  17. package/dist/UserRow.js +2 -0
  18. package/dist/react-ui/src/Canvas.d.ts +7 -1
  19. package/dist/react-ui/src/Canvas.js +26 -4
  20. package/dist/react-ui/src/ctxAnswer.js +21 -0
  21. package/dist/react-ui/src/ctxDateSettings.js +7 -5
  22. package/dist/react-ui/src/ctxRecordPresentation.js +34 -0
  23. package/dist/react-ui/src/ctxUploads.js +23 -0
  24. package/dist/styles.css +627 -29
  25. package/dist/ui-public/icons/index.js +294 -367
  26. package/dist/ui-public/icons/lucide/app-window.js +33 -0
  27. package/dist/ui-public/icons/lucide/arrow-big-down.js +22 -0
  28. package/dist/ui-public/icons/lucide/arrow-down-a-z.js +28 -0
  29. package/dist/ui-public/icons/lucide/arrow-down-from-line.js +26 -0
  30. package/dist/ui-public/icons/lucide/arrow-down.js +22 -0
  31. package/dist/ui-public/icons/lucide/arrow-left.js +22 -0
  32. package/dist/ui-public/icons/lucide/arrow-right-left.js +27 -0
  33. package/dist/ui-public/icons/lucide/arrow-right.js +22 -0
  34. package/dist/ui-public/icons/lucide/arrow-up-down.js +27 -0
  35. package/dist/ui-public/icons/lucide/arrow-up-from-line.js +26 -0
  36. package/dist/ui-public/icons/lucide/arrow-up.js +22 -0
  37. package/dist/ui-public/icons/lucide/ban.js +26 -0
  38. package/dist/ui-public/icons/lucide/book.js +22 -0
  39. package/dist/ui-public/icons/lucide/bookmark.js +22 -0
  40. package/dist/ui-public/icons/lucide/calendar.js +33 -0
  41. package/dist/ui-public/icons/{regular → lucide}/check.js +9 -3
  42. package/dist/ui-public/icons/{regular → lucide}/chevron-down.js +9 -3
  43. package/dist/ui-public/icons/{regular → lucide}/chevron-left.js +9 -3
  44. package/dist/ui-public/icons/{regular → lucide}/chevron-right.js +9 -3
  45. package/dist/ui-public/icons/lucide/chevrons-down.js +22 -0
  46. package/dist/ui-public/icons/lucide/chevrons-left.js +22 -0
  47. package/dist/ui-public/icons/lucide/chevrons-right.js +22 -0
  48. package/dist/ui-public/icons/lucide/circle-arrow-up.js +30 -0
  49. package/dist/ui-public/icons/lucide/circle-check.js +26 -0
  50. package/dist/ui-public/icons/lucide/circle-dot.js +30 -0
  51. package/dist/ui-public/icons/lucide/circle-exclamation-point.js +40 -0
  52. package/dist/ui-public/icons/lucide/circle-question-mark.js +30 -0
  53. package/dist/ui-public/icons/lucide/clock.js +26 -0
  54. package/dist/ui-public/icons/lucide/code.js +22 -0
  55. package/dist/ui-public/icons/lucide/command.js +22 -0
  56. package/dist/ui-public/icons/lucide/copy-plus.js +44 -0
  57. package/dist/ui-public/icons/lucide/copy.js +29 -0
  58. package/dist/ui-public/icons/lucide/corner-left-up.js +22 -0
  59. package/dist/ui-public/icons/lucide/database.js +31 -0
  60. package/dist/ui-public/icons/lucide/download.js +26 -0
  61. package/dist/ui-public/icons/lucide/earth.js +31 -0
  62. package/dist/ui-public/icons/lucide/ellipsis-vertical.js +38 -0
  63. package/dist/ui-public/icons/lucide/ellipsis.js +38 -0
  64. package/dist/ui-public/icons/lucide/external-link.js +26 -0
  65. package/dist/ui-public/icons/lucide/eye-off.js +27 -0
  66. package/dist/ui-public/icons/lucide/eye.js +26 -0
  67. package/dist/ui-public/icons/lucide/file-code.js +27 -0
  68. package/dist/ui-public/icons/lucide/file-output.js +27 -0
  69. package/dist/ui-public/icons/lucide/flask-conical.js +26 -0
  70. package/dist/ui-public/icons/lucide/fold-vertical.js +31 -0
  71. package/dist/ui-public/icons/lucide/folder-open.js +22 -0
  72. package/dist/ui-public/icons/lucide/folder-plus.js +26 -0
  73. package/dist/ui-public/icons/lucide/folder.js +22 -0
  74. package/dist/ui-public/icons/lucide/folders.js +22 -0
  75. package/dist/ui-public/icons/lucide/funnel.js +22 -0
  76. package/dist/ui-public/icons/lucide/gift.js +33 -0
  77. package/dist/ui-public/icons/lucide/git-branch.js +34 -0
  78. package/dist/ui-public/icons/lucide/git-fork.js +40 -0
  79. package/dist/ui-public/icons/lucide/globe.js +30 -0
  80. package/dist/ui-public/icons/lucide/grip-vertical.js +53 -0
  81. package/dist/ui-public/icons/lucide/hand.js +27 -0
  82. package/dist/ui-public/icons/lucide/hard-hat.js +33 -0
  83. package/dist/ui-public/icons/lucide/heading-1.js +27 -0
  84. package/dist/ui-public/icons/lucide/heading-2.js +27 -0
  85. package/dist/ui-public/icons/lucide/heading-3.js +28 -0
  86. package/dist/ui-public/icons/lucide/heading-4.js +28 -0
  87. package/dist/ui-public/icons/lucide/heading-5.js +28 -0
  88. package/dist/ui-public/icons/lucide/heading-6.js +32 -0
  89. package/dist/ui-public/icons/lucide/highlighter.js +22 -0
  90. package/dist/ui-public/icons/lucide/hourglass.js +27 -0
  91. package/dist/ui-public/icons/lucide/house.js +22 -0
  92. package/dist/ui-public/icons/lucide/image.js +37 -0
  93. package/dist/ui-public/icons/lucide/images.js +38 -0
  94. package/dist/ui-public/icons/lucide/info.js +30 -0
  95. package/dist/ui-public/icons/lucide/italic.js +41 -0
  96. package/dist/ui-public/icons/lucide/keyboard.js +38 -0
  97. package/dist/ui-public/icons/lucide/languages.js +29 -0
  98. package/dist/ui-public/icons/lucide/layers.js +26 -0
  99. package/dist/ui-public/icons/lucide/layout-grid.js +51 -0
  100. package/dist/ui-public/icons/lucide/letter-b.js +22 -0
  101. package/dist/ui-public/icons/lucide/life-buoy.js +37 -0
  102. package/dist/ui-public/icons/lucide/link.js +22 -0
  103. package/dist/ui-public/icons/lucide/list-indent-decrease.js +27 -0
  104. package/dist/ui-public/icons/lucide/list-indent-increase.js +27 -0
  105. package/dist/ui-public/icons/lucide/list-ordered.js +29 -0
  106. package/dist/ui-public/icons/lucide/list-tree.js +28 -0
  107. package/dist/ui-public/icons/lucide/list.js +29 -0
  108. package/dist/ui-public/icons/lucide/log-out.js +26 -0
  109. package/dist/ui-public/icons/lucide/mail.js +28 -0
  110. package/dist/ui-public/icons/lucide/map-pin.js +26 -0
  111. package/dist/ui-public/icons/lucide/map-pinned.js +30 -0
  112. package/dist/ui-public/icons/lucide/maximize.js +27 -0
  113. package/dist/ui-public/icons/lucide/menu.js +26 -0
  114. package/dist/ui-public/icons/lucide/messages-square.js +22 -0
  115. package/dist/ui-public/icons/lucide/minimize.js +27 -0
  116. package/dist/ui-public/icons/lucide/minus.js +22 -0
  117. package/dist/ui-public/icons/lucide/notepad-text.js +36 -0
  118. package/dist/ui-public/icons/lucide/octagon-exclamation-point.js +26 -0
  119. package/dist/ui-public/icons/lucide/palette.js +48 -0
  120. package/dist/ui-public/icons/lucide/panel-left.js +28 -0
  121. package/dist/ui-public/icons/lucide/panel-right.js +28 -0
  122. package/dist/ui-public/icons/lucide/pause.js +34 -0
  123. package/dist/ui-public/icons/lucide/pen.js +22 -0
  124. package/dist/ui-public/icons/lucide/pilcrow.js +26 -0
  125. package/dist/ui-public/icons/lucide/pipette.js +26 -0
  126. package/dist/ui-public/icons/lucide/play.js +22 -0
  127. package/dist/ui-public/icons/lucide/plus.js +22 -0
  128. package/dist/ui-public/icons/lucide/quote.js +22 -0
  129. package/dist/ui-public/icons/lucide/redo-2.js +22 -0
  130. package/dist/ui-public/icons/lucide/refresh-cw.js +27 -0
  131. package/dist/ui-public/icons/lucide/rotate-ccw-clock.js +26 -0
  132. package/dist/ui-public/icons/lucide/rotate-ccw.js +22 -0
  133. package/dist/ui-public/icons/lucide/search.js +26 -0
  134. package/dist/ui-public/icons/lucide/send.js +22 -0
  135. package/dist/ui-public/icons/lucide/settings-2.js +35 -0
  136. package/dist/ui-public/icons/lucide/settings.js +26 -0
  137. package/dist/ui-public/icons/lucide/sliders-horizontal.js +32 -0
  138. package/dist/ui-public/icons/lucide/smartphone.js +29 -0
  139. package/dist/ui-public/icons/lucide/square-arrow-left.js +32 -0
  140. package/dist/ui-public/icons/lucide/square-arrow-up-right.js +32 -0
  141. package/dist/ui-public/icons/lucide/square-code.js +32 -0
  142. package/dist/ui-public/icons/lucide/square-dashed.js +35 -0
  143. package/dist/ui-public/icons/lucide/square-pen.js +22 -0
  144. package/dist/ui-public/icons/lucide/square-plus.js +32 -0
  145. package/dist/ui-public/icons/lucide/square-terminal.js +33 -0
  146. package/dist/ui-public/icons/lucide/store.js +26 -0
  147. package/dist/ui-public/icons/lucide/strikethrough.js +31 -0
  148. package/dist/ui-public/icons/lucide/table.js +33 -0
  149. package/dist/ui-public/icons/lucide/tag.js +27 -0
  150. package/dist/ui-public/icons/lucide/text-align-center.js +26 -0
  151. package/dist/ui-public/icons/lucide/text-align-end.js +26 -0
  152. package/dist/ui-public/icons/lucide/text-align-justify.js +26 -0
  153. package/dist/ui-public/icons/lucide/text-align-start.js +26 -0
  154. package/dist/ui-public/icons/lucide/toolbox.js +28 -0
  155. package/dist/ui-public/icons/lucide/trash.js +28 -0
  156. package/dist/ui-public/icons/lucide/triangle-exclamation-point.js +26 -0
  157. package/dist/ui-public/icons/lucide/underline.js +27 -0
  158. package/dist/ui-public/icons/lucide/undo-2.js +22 -0
  159. package/dist/ui-public/icons/lucide/unfold-vertical.js +31 -0
  160. package/dist/ui-public/icons/lucide/user-lock.js +37 -0
  161. package/dist/ui-public/icons/lucide/user-minus.js +35 -0
  162. package/dist/ui-public/icons/lucide/user-round-arrow-left.js +31 -0
  163. package/dist/ui-public/icons/lucide/user.js +26 -0
  164. package/dist/ui-public/icons/lucide/x.js +22 -0
  165. package/dist/ui-public/locales/en.js +45 -5
  166. package/dist/ui-public/src/Message.d.ts +3 -4
  167. package/dist/ui-public/src/UiTextKey.d.ts +1 -1
  168. package/dist/ui-public/src/actions/Actions/ActionTooltip.js +1 -1
  169. package/dist/ui-public/src/actions/Actions/registry.d.ts +2 -2
  170. package/dist/ui-public/src/actions/Actions/registry.js +2 -2
  171. package/dist/ui-public/src/actions/Button.d.ts +16 -11
  172. package/dist/ui-public/src/actions/Button.js +7 -1
  173. package/dist/ui-public/src/actions/Dropdown/Menu.d.ts +2 -2
  174. package/dist/ui-public/src/actions/Dropdown/Option.d.ts +7 -7
  175. package/dist/ui-public/src/actions/Dropdown/index.d.ts +1 -1
  176. package/dist/ui-public/src/actions/Dropdown/triggers/ButtonTrigger.d.ts +5 -5
  177. package/dist/ui-public/src/actions/Dropdown/triggers/DropdownTriggerButton.d.ts +2 -2
  178. package/dist/ui-public/src/actions/Dropdown/triggers/IconTrigger.d.ts +6 -6
  179. package/dist/ui-public/src/actions/Dropdown/triggers/IconTrigger.js +1 -1
  180. package/dist/ui-public/src/actions/EditorToolbar/Button.d.ts +1 -1
  181. package/dist/ui-public/src/actions/MultipleSelectionActionBar.d.ts +1 -1
  182. package/dist/ui-public/src/actions/SplitButton/Caret.js +2 -2
  183. package/dist/ui-public/src/actions/SplitButton/Halves.js +1 -1
  184. package/dist/ui-public/src/actions/SplitButton/index.d.ts +3 -3
  185. package/dist/ui-public/src/actions/disabledReason.d.ts +4 -4
  186. package/dist/ui-public/src/actions/disabledReason.js +1 -1
  187. package/dist/ui-public/src/content/Avatar.d.ts +3 -3
  188. package/dist/ui-public/src/content/Avatar.js +2 -2
  189. package/dist/ui-public/src/content/CodeSnippet.d.ts +1 -1
  190. package/dist/ui-public/src/content/CopyableValue.d.ts +1 -1
  191. package/dist/ui-public/src/content/EnvironmentPill.d.ts +1 -1
  192. package/dist/ui-public/src/content/EnvironmentPill.js +1 -1
  193. package/dist/ui-public/src/content/IconAvatar.d.ts +1 -1
  194. package/dist/ui-public/src/content/ItemStatus.d.ts +1 -1
  195. package/dist/ui-public/src/content/Pill.d.ts +1 -1
  196. package/dist/ui-public/src/content/SmartDate.d.ts +1 -1
  197. package/dist/ui-public/src/content/UploadPreview/asset.js +200 -0
  198. package/dist/ui-public/src/content/UploadPreview/audio.js +120 -0
  199. package/dist/ui-public/src/content/{UploadPreview.d.ts → UploadPreview/box.d.ts} +10 -10
  200. package/dist/ui-public/src/content/{UploadPreview.js → UploadPreview/box.js} +7 -7
  201. package/dist/ui-public/src/content/{uploadPreviewFit.d.ts → UploadPreview/fit.d.ts} +2 -2
  202. package/dist/ui-public/src/content/{uploadPreviewFit.js → UploadPreview/fit.js} +3 -3
  203. package/dist/ui-public/src/content/UploadPreview/index.d.ts +61 -0
  204. package/dist/ui-public/src/content/UploadPreview/index.js +36 -0
  205. package/dist/ui-public/src/content/UploadPreview/presentation.js +63 -0
  206. package/dist/ui-public/src/content/UploadPreview/thumbhash.js +91 -0
  207. package/dist/ui-public/src/content/UploadPreview/upload.d.ts +104 -0
  208. package/dist/ui-public/src/content/UploadPreview/upload.js +112 -0
  209. package/dist/ui-public/src/content/UploadThreatTriangle.js +1 -1
  210. package/dist/ui-public/src/content/UsageMeter.d.ts +1 -1
  211. package/dist/ui-public/src/content/ValidityTriangles.d.ts +1 -1
  212. package/dist/ui-public/src/content/ValidityTriangles.js +1 -1
  213. package/dist/ui-public/src/feedback/BlankSlate.d.ts +5 -5
  214. package/dist/ui-public/src/feedback/Callout.d.ts +5 -5
  215. package/dist/ui-public/src/feedback/Callout.js +1 -1
  216. package/dist/ui-public/src/feedback/ProgressBar.d.ts +4 -4
  217. package/dist/ui-public/src/feedback/Spinner.d.ts +6 -6
  218. package/dist/ui-public/src/feedback/Spinner.js +1 -1
  219. package/dist/ui-public/src/form/DateInput.d.ts +13 -0
  220. package/dist/ui-public/src/form/DateInput.js +16 -0
  221. package/dist/ui-public/src/form/DateTimeInput/Base.d.ts +89 -0
  222. package/dist/ui-public/src/form/DateTimeInput/Base.js +330 -0
  223. package/dist/ui-public/src/form/DateTimeInput/CalendarGrid.d.ts +29 -0
  224. package/dist/ui-public/src/form/DateTimeInput/CalendarGrid.js +195 -0
  225. package/dist/ui-public/src/form/DateTimeInput/dateText.js +38 -0
  226. package/dist/ui-public/src/form/DateTimeInput/index.d.ts +10 -0
  227. package/dist/ui-public/src/form/DateTimeInput/index.js +18 -0
  228. package/dist/ui-public/src/form/DateTimeInput/value.js +31 -0
  229. package/dist/ui-public/src/form/DateTimeRangeInput/Panel.js +167 -0
  230. package/dist/ui-public/src/form/DateTimeRangeInput/index.d.ts +123 -0
  231. package/dist/ui-public/src/form/DateTimeRangeInput/index.js +186 -0
  232. package/dist/ui-public/src/form/DateTimeRangeInput/rangeLabel.js +46 -0
  233. package/dist/ui-public/src/form/FieldHint.d.ts +2 -2
  234. package/dist/ui-public/src/form/FieldWrapper.d.ts +9 -9
  235. package/dist/ui-public/src/form/FieldWrapper.js +3 -3
  236. package/dist/ui-public/src/form/FilterBuilder/Editor.js +123 -0
  237. package/dist/ui-public/src/form/FilterBuilder/index.d.ts +9 -0
  238. package/dist/ui-public/src/form/FilterBuilder/index.js +294 -0
  239. package/dist/ui-public/src/form/FilterBuilder/types.d.ts +188 -0
  240. package/dist/ui-public/src/form/FilterBuilder/values.js +86 -0
  241. package/dist/ui-public/src/form/InputGroup.d.ts +2 -2
  242. package/dist/ui-public/src/form/InputGroup.js +1 -1
  243. package/dist/ui-public/src/form/KeyValueList.d.ts +1 -1
  244. package/dist/ui-public/src/form/Label.d.ts +2 -2
  245. package/dist/ui-public/src/form/PasswordInput.js +1 -9
  246. package/dist/ui-public/src/form/RadioGroupInput.d.ts +2 -2
  247. package/dist/ui-public/src/form/RadioGroupInput.js +1 -1
  248. package/dist/ui-public/src/form/SelectInput/SelectMenu.d.ts +2 -2
  249. package/dist/ui-public/src/form/SelectInput/index.d.ts +3 -3
  250. package/dist/ui-public/src/form/SwitchInput.d.ts +2 -2
  251. package/dist/ui-public/src/form/SwitchList.d.ts +1 -1
  252. package/dist/ui-public/src/form/SwitchList.js +1 -1
  253. package/dist/ui-public/src/form/TableList.d.ts +2 -2
  254. package/dist/ui-public/src/form/TextareaInput.js +1 -1
  255. package/dist/ui-public/src/form/inputProps.d.ts +6 -6
  256. package/dist/ui-public/src/hooks/useAsyncSelectOptions.d.ts +1 -1
  257. package/dist/ui-public/src/hooks/useSmartRowClick.d.ts +1 -1
  258. package/dist/ui-public/src/hooks/useSmartRowClick.js +1 -1
  259. package/dist/ui-public/src/layout/Page/PageGroup.d.ts +2 -2
  260. package/dist/ui-public/src/layout/Page/PageGroup.js +1 -1
  261. package/dist/ui-public/src/layout/Pane/FormHeader.d.ts +1 -1
  262. package/dist/ui-public/src/layout/Pane/FormHeader.js +1 -1
  263. package/dist/ui-public/src/layout/Pane/ListFilter.d.ts +1 -1
  264. package/dist/ui-public/src/layout/Pane/ListPresets.d.ts +1 -1
  265. package/dist/ui-public/src/layout/Pane/PaneHeader.d.ts +1 -1
  266. package/dist/ui-public/src/layout/Pane/index.d.ts +2 -2
  267. package/dist/ui-public/src/layout/SidebarPanel.d.ts +1 -1
  268. package/dist/ui-public/src/layout/SplitPane/Rail.js +1 -1
  269. package/dist/ui-public/src/layout/SplitPane/index.d.ts +6 -6
  270. package/dist/ui-public/src/layout/Toolbar/AddNewButton.d.ts +2 -2
  271. package/dist/ui-public/src/layout/Toolbar/FilterToggle.d.ts +1 -1
  272. package/dist/ui-public/src/layout/Toolbar/FilterToggle.js +12 -4
  273. package/dist/ui-public/src/layout/Toolbar/Help.d.ts +3 -3
  274. package/dist/ui-public/src/layout/Toolbar/Help.js +2 -2
  275. package/dist/ui-public/src/layout/Toolbar/Note.d.ts +1 -1
  276. package/dist/ui-public/src/layout/Toolbar/Note.js +1 -1
  277. package/dist/ui-public/src/layout/Toolbar/Pagination.d.ts +1 -1
  278. package/dist/ui-public/src/layout/Toolbar/Pagination.js +1 -1
  279. package/dist/ui-public/src/layout/Toolbar/PresetsTitle.d.ts +3 -3
  280. package/dist/ui-public/src/layout/Toolbar/PresetsTitle.js +2 -2
  281. package/dist/ui-public/src/layout/Toolbar/PrimaryButton.d.ts +3 -3
  282. package/dist/ui-public/src/layout/Toolbar/Root.d.ts +1 -1
  283. package/dist/ui-public/src/layout/Toolbar/Root.js +4 -1
  284. package/dist/ui-public/src/layout/Toolbar/ToolbarTitleTrigger.js +1 -1
  285. package/dist/ui-public/src/lists/CardList.d.ts +3 -3
  286. package/dist/ui-public/src/lists/EmptySlot.d.ts +1 -1
  287. package/dist/ui-public/src/lists/InfoList/User.d.ts +1 -1
  288. package/dist/ui-public/src/lists/InfoList/Value.d.ts +1 -1
  289. package/dist/ui-public/src/lists/InfoList/Value.js +1 -1
  290. package/dist/ui-public/src/lists/InfoList/index.d.ts +3 -3
  291. package/dist/ui-public/src/lists/InfoList/index.js +1 -1
  292. package/dist/ui-public/src/lists/MediaCard.d.ts +7 -7
  293. package/dist/ui-public/src/lists/RecordRow/Image.d.ts +24 -0
  294. package/dist/ui-public/src/lists/RecordRow/Image.js +22 -0
  295. package/dist/ui-public/src/lists/RecordRow/List.d.ts +26 -0
  296. package/dist/ui-public/src/lists/RecordRow/List.js +30 -0
  297. package/dist/ui-public/src/lists/RecordRow/context.js +31 -0
  298. package/dist/ui-public/src/lists/RecordRow/index.d.ts +94 -0
  299. package/dist/ui-public/src/lists/RecordRow/index.js +122 -0
  300. package/dist/ui-public/src/lists/RecordRow/presentation.js +73 -0
  301. package/dist/ui-public/src/lists/RecordRow/types.d.ts +58 -0
  302. package/dist/ui-public/src/lists/RowList.d.ts +5 -5
  303. package/dist/ui-public/src/lists/SettingsList.d.ts +3 -3
  304. package/dist/ui-public/src/lists/SettingsList.js +2 -2
  305. package/dist/ui-public/src/lists/Table/Row.d.ts +5 -5
  306. package/dist/ui-public/src/lists/Table/Table.d.ts +3 -3
  307. package/dist/ui-public/src/lists/Table/TreeToggle.d.ts +2 -2
  308. package/dist/ui-public/src/lists/Table/TreeToggle.js +1 -1
  309. package/dist/ui-public/src/lists/Table/cells/LinkCell.d.ts +1 -1
  310. package/dist/ui-public/src/lists/TreeRow/Action.d.ts +1 -1
  311. package/dist/ui-public/src/lists/TreeRow/Action.js +1 -1
  312. package/dist/ui-public/src/lists/TreeRow/Link.d.ts +1 -1
  313. package/dist/ui-public/src/lists/TreeRow/Link.js +1 -1
  314. package/dist/ui-public/src/lists/UploadCard.d.ts +66 -3
  315. package/dist/ui-public/src/lists/UploadCard.js +116 -7
  316. package/dist/ui-public/src/lists/UserRow.d.ts +122 -0
  317. package/dist/ui-public/src/lists/UserRow.js +104 -0
  318. package/dist/ui-public/src/lists/dnd/DragHandle.d.ts +2 -2
  319. package/dist/ui-public/src/lists/dnd/SortableList.d.ts +1 -1
  320. package/dist/ui-public/src/lists/dnd/dropTargetClassName.d.ts +1 -1
  321. package/dist/ui-public/src/lists/dnd/tree/SortableTree.d.ts +2 -2
  322. package/dist/ui-public/src/navigation/Chevron.d.ts +4 -4
  323. package/dist/ui-public/src/navigation/Chevron.js +1 -1
  324. package/dist/ui-public/src/navigation/Link.d.ts +5 -5
  325. package/dist/ui-public/src/navigation/Link.js +1 -1
  326. package/dist/ui-public/src/navigation/NavList.d.ts +1 -1
  327. package/dist/ui-public/src/navigation/NavList.js +1 -1
  328. package/dist/ui-public/src/navigation/NavigationProvider.d.ts +1 -1
  329. package/dist/ui-public/src/navigation/SegmentedControl.d.ts +2 -2
  330. package/dist/ui-public/src/navigation/SettingsMenu.d.ts +8 -8
  331. package/dist/ui-public/src/navigation/SettingsMenu.js +1 -1
  332. package/dist/ui-public/src/navigation/SidebarTree/SidebarTreeNode.d.ts +4 -4
  333. package/dist/ui-public/src/navigation/SidebarTree/SidebarTreeNodeActions.d.ts +3 -0
  334. package/dist/ui-public/src/navigation/SidebarTree/SidebarTreeNodeActions.js +2 -1
  335. package/dist/ui-public/src/overlays/FullscreenModal/TitleContext.d.ts +1 -1
  336. package/dist/ui-public/src/overlays/FullscreenModal/TitleContext.js +1 -1
  337. package/dist/ui-public/src/overlays/HoverCard/index.js +1 -1
  338. package/dist/ui-public/src/overlays/NewZIndex.d.ts +1 -1
  339. package/dist/ui-public/src/overlays/NewZIndex.js +1 -1
  340. package/dist/ui-public/src/overlays/Popover.d.ts +1 -1
  341. package/dist/ui-public/src/overlays/PortalWrapper.js +1 -1
  342. package/dist/ui-public/src/overlays/useModalClose.js +3 -3
  343. package/dist/ui-public/src/patterns/ListDetail/FloatingDetail.js +71 -0
  344. package/dist/ui-public/src/patterns/ListDetail/Overview.js +2 -2
  345. package/dist/ui-public/src/patterns/ListDetail/Page.d.ts +8 -9
  346. package/dist/ui-public/src/patterns/ListDetail/Page.js +12 -9
  347. package/dist/ui-public/src/patterns/ListDetail/Panel.d.ts +2 -2
  348. package/dist/ui-public/src/patterns/ListDetail/Panel.js +12 -11
  349. package/dist/ui-public/src/patterns/ListDetail/Split.d.ts +25 -11
  350. package/dist/ui-public/src/patterns/ListDetail/Split.js +99 -115
  351. package/dist/ui-public/src/patterns/ListDetail/index.d.ts +4 -3
  352. package/dist/ui-public/src/patterns/ListDetail/useDetailWidthDrag.js +43 -0
  353. package/dist/ui-public/src/patterns/ListFormPage.d.ts +3 -3
  354. package/dist/ui-public/src/patterns/ListFormPage.js +1 -1
  355. package/dist/ui-public/src/semantic/Heading.d.ts +1 -1
  356. package/dist/ui-public/src/semantic/Heading.js +1 -1
  357. package/dist/ui-public/src/semantic/Image.js +1 -1
  358. package/dist/ui-public/src/semantic/Nav.d.ts +3 -3
  359. package/dist/ui-public/src/semantic/Nav.js +3 -3
  360. package/dist/ui-public/src/semantic/RawButton.d.ts +3 -3
  361. package/dist/ui-public/src/semantic/RawButton.js +1 -1
  362. package/dist/ui-public/src/semantic/Search.d.ts +1 -1
  363. package/dist/ui-public/src/semantic/Search.js +1 -1
  364. package/dist/ui-public/src/utils/format.d.ts +21 -0
  365. package/dist/ui-public/src/utils/format.js +20 -0
  366. package/dist/ui-public/src/utils/formatDate.d.ts +10 -2
  367. package/dist/ui-public/src/utils/formatDate.js +4 -4
  368. package/dist/ui-public/src/utils/tickBatcher.js +44 -0
  369. package/dist/ui-public/src/utils/timezones.js +277 -0
  370. package/dist/ui-public/src/utils/weekStartForLocale.js +25 -0
  371. package/dist/utils/format.d.ts +1 -0
  372. package/dist/utils/format.js +2 -0
  373. package/package.json +3 -3
  374. package/dist/ui-public/icons/brands/gitlab.js +0 -15
  375. package/dist/ui-public/icons/brands/markdown.js +0 -15
  376. package/dist/ui-public/icons/custom/language.js +0 -16
  377. package/dist/ui-public/icons/custom/masonry.js +0 -21
  378. package/dist/ui-public/icons/light/eye-slash.js +0 -16
  379. package/dist/ui-public/icons/light/eye.js +0 -16
  380. package/dist/ui-public/icons/regular/align-left.js +0 -15
  381. package/dist/ui-public/icons/regular/arrow-down-a-z.js +0 -16
  382. package/dist/ui-public/icons/regular/arrow-down-from-line.js +0 -16
  383. package/dist/ui-public/icons/regular/arrow-down-to-line.js +0 -15
  384. package/dist/ui-public/icons/regular/arrow-down.js +0 -16
  385. package/dist/ui-public/icons/regular/arrow-left.js +0 -16
  386. package/dist/ui-public/icons/regular/arrow-right-arrow-left.js +0 -16
  387. package/dist/ui-public/icons/regular/arrow-right-from-bracket.js +0 -16
  388. package/dist/ui-public/icons/regular/arrow-right.js +0 -16
  389. package/dist/ui-public/icons/regular/arrow-rotate-left.js +0 -15
  390. package/dist/ui-public/icons/regular/arrow-rotate-right.js +0 -16
  391. package/dist/ui-public/icons/regular/arrow-turn-up.js +0 -16
  392. package/dist/ui-public/icons/regular/arrow-up-arrow-down.js +0 -16
  393. package/dist/ui-public/icons/regular/arrow-up-from-line.js +0 -16
  394. package/dist/ui-public/icons/regular/arrow-up-right-from-square.js +0 -16
  395. package/dist/ui-public/icons/regular/arrow-up-to-line.js +0 -15
  396. package/dist/ui-public/icons/regular/arrow-up.js +0 -16
  397. package/dist/ui-public/icons/regular/arrows-from-line.js +0 -16
  398. package/dist/ui-public/icons/regular/arrows-rotate.js +0 -16
  399. package/dist/ui-public/icons/regular/arrows-to-line.js +0 -16
  400. package/dist/ui-public/icons/regular/arrows-turn-to-dots.js +0 -15
  401. package/dist/ui-public/icons/regular/badge-check.js +0 -15
  402. package/dist/ui-public/icons/regular/ballot-check.js +0 -15
  403. package/dist/ui-public/icons/regular/ban.js +0 -16
  404. package/dist/ui-public/icons/regular/bars.js +0 -16
  405. package/dist/ui-public/icons/regular/bold.js +0 -15
  406. package/dist/ui-public/icons/regular/bolt.js +0 -15
  407. package/dist/ui-public/icons/regular/book.js +0 -16
  408. package/dist/ui-public/icons/regular/bookmark.js +0 -16
  409. package/dist/ui-public/icons/regular/brackets-curly.js +0 -15
  410. package/dist/ui-public/icons/regular/browser.js +0 -16
  411. package/dist/ui-public/icons/regular/calendar-clock.js +0 -15
  412. package/dist/ui-public/icons/regular/calendar.js +0 -16
  413. package/dist/ui-public/icons/regular/chart-area.js +0 -15
  414. package/dist/ui-public/icons/regular/chevrons-down.js +0 -16
  415. package/dist/ui-public/icons/regular/chevrons-left.js +0 -16
  416. package/dist/ui-public/icons/regular/chevrons-right.js +0 -16
  417. package/dist/ui-public/icons/regular/circle-arrow-up.js +0 -16
  418. package/dist/ui-public/icons/regular/circle-check.js +0 -16
  419. package/dist/ui-public/icons/regular/circle-dot.js +0 -16
  420. package/dist/ui-public/icons/regular/circle-exclamation.js +0 -16
  421. package/dist/ui-public/icons/regular/circle-info.js +0 -16
  422. package/dist/ui-public/icons/regular/circle-question.js +0 -16
  423. package/dist/ui-public/icons/regular/clapperboard-play.js +0 -15
  424. package/dist/ui-public/icons/regular/clipboard.js +0 -15
  425. package/dist/ui-public/icons/regular/clock-rotate-left.js +0 -16
  426. package/dist/ui-public/icons/regular/clock.js +0 -16
  427. package/dist/ui-public/icons/regular/clone.js +0 -16
  428. package/dist/ui-public/icons/regular/cloud-arrow-down.js +0 -15
  429. package/dist/ui-public/icons/regular/code-branch.js +0 -16
  430. package/dist/ui-public/icons/regular/code-fork.js +0 -16
  431. package/dist/ui-public/icons/regular/command.js +0 -16
  432. package/dist/ui-public/icons/regular/comments.js +0 -16
  433. package/dist/ui-public/icons/regular/copy.js +0 -16
  434. package/dist/ui-public/icons/regular/cube.js +0 -15
  435. package/dist/ui-public/icons/regular/cubes.js +0 -15
  436. package/dist/ui-public/icons/regular/dash.js +0 -16
  437. package/dist/ui-public/icons/regular/database.js +0 -16
  438. package/dist/ui-public/icons/regular/diamond.js +0 -15
  439. package/dist/ui-public/icons/regular/down.js +0 -16
  440. package/dist/ui-public/icons/regular/download.js +0 -16
  441. package/dist/ui-public/icons/regular/earth-europe.js +0 -16
  442. package/dist/ui-public/icons/regular/ellipsis-vertical.js +0 -16
  443. package/dist/ui-public/icons/regular/ellipsis.js +0 -16
  444. package/dist/ui-public/icons/regular/envelope.js +0 -16
  445. package/dist/ui-public/icons/regular/expand.js +0 -16
  446. package/dist/ui-public/icons/regular/eye-dropper.js +0 -16
  447. package/dist/ui-public/icons/regular/eye.js +0 -16
  448. package/dist/ui-public/icons/regular/file-export.js +0 -16
  449. package/dist/ui-public/icons/regular/file-lines.js +0 -15
  450. package/dist/ui-public/icons/regular/file-shield.js +0 -15
  451. package/dist/ui-public/icons/regular/file.js +0 -15
  452. package/dist/ui-public/icons/regular/filter.js +0 -16
  453. package/dist/ui-public/icons/regular/fire-flame-curved.js +0 -15
  454. package/dist/ui-public/icons/regular/flask-gear.js +0 -16
  455. package/dist/ui-public/icons/regular/flask.js +0 -16
  456. package/dist/ui-public/icons/regular/folder-gear.js +0 -15
  457. package/dist/ui-public/icons/regular/folder-magnifying-glass.js +0 -15
  458. package/dist/ui-public/icons/regular/folder-open.js +0 -16
  459. package/dist/ui-public/icons/regular/folder-plus.js +0 -16
  460. package/dist/ui-public/icons/regular/folder.js +0 -16
  461. package/dist/ui-public/icons/regular/folders.js +0 -16
  462. package/dist/ui-public/icons/regular/gear.js +0 -16
  463. package/dist/ui-public/icons/regular/gift.js +0 -16
  464. package/dist/ui-public/icons/regular/globe.js +0 -16
  465. package/dist/ui-public/icons/regular/grid-2.js +0 -16
  466. package/dist/ui-public/icons/regular/grip-dots-vertical.js +0 -16
  467. package/dist/ui-public/icons/regular/hand.js +0 -16
  468. package/dist/ui-public/icons/regular/hourglass-clock.js +0 -16
  469. package/dist/ui-public/icons/regular/house.js +0 -16
  470. package/dist/ui-public/icons/regular/images.js +0 -16
  471. package/dist/ui-public/icons/regular/input-numeric.js +0 -15
  472. package/dist/ui-public/icons/regular/input-text.js +0 -15
  473. package/dist/ui-public/icons/regular/keyboard.js +0 -16
  474. package/dist/ui-public/icons/regular/layer-group.js +0 -16
  475. package/dist/ui-public/icons/regular/life-ring.js +0 -16
  476. package/dist/ui-public/icons/regular/link-simple.js +0 -15
  477. package/dist/ui-public/icons/regular/link.js +0 -16
  478. package/dist/ui-public/icons/regular/list-tree.js +0 -16
  479. package/dist/ui-public/icons/regular/list.js +0 -16
  480. package/dist/ui-public/icons/regular/magnifying-glass-chart.js +0 -15
  481. package/dist/ui-public/icons/regular/magnifying-glass.js +0 -16
  482. package/dist/ui-public/icons/regular/map-location-dot.js +0 -16
  483. package/dist/ui-public/icons/regular/memo.js +0 -16
  484. package/dist/ui-public/icons/regular/mobile-screen-button.js +0 -16
  485. package/dist/ui-public/icons/regular/octagon-exclamation.js +0 -16
  486. package/dist/ui-public/icons/regular/palette.js +0 -16
  487. package/dist/ui-public/icons/regular/paper-plane.js +0 -16
  488. package/dist/ui-public/icons/regular/paragraph.js +0 -15
  489. package/dist/ui-public/icons/regular/paste.js +0 -15
  490. package/dist/ui-public/icons/regular/pause.js +0 -16
  491. package/dist/ui-public/icons/regular/pen-paintbrush.js +0 -15
  492. package/dist/ui-public/icons/regular/pen-to-square.js +0 -16
  493. package/dist/ui-public/icons/regular/pen.js +0 -16
  494. package/dist/ui-public/icons/regular/people-arrows.js +0 -16
  495. package/dist/ui-public/icons/regular/photo-film.js +0 -15
  496. package/dist/ui-public/icons/regular/play.js +0 -16
  497. package/dist/ui-public/icons/regular/puzzle-piece.js +0 -15
  498. package/dist/ui-public/icons/regular/receipt.js +0 -16
  499. package/dist/ui-public/icons/regular/rectangle-barcode.js +0 -15
  500. package/dist/ui-public/icons/regular/rectangle-list.js +0 -15
  501. package/dist/ui-public/icons/regular/right-left.js +0 -15
  502. package/dist/ui-public/icons/regular/rotate-left.js +0 -16
  503. package/dist/ui-public/icons/regular/shield.js +0 -15
  504. package/dist/ui-public/icons/regular/sidebar-flip.js +0 -16
  505. package/dist/ui-public/icons/regular/sidebar.js +0 -16
  506. package/dist/ui-public/icons/regular/sliders.js +0 -16
  507. package/dist/ui-public/icons/regular/sparkles.js +0 -15
  508. package/dist/ui-public/icons/regular/square-caret-down.js +0 -15
  509. package/dist/ui-public/icons/regular/square-check.js +0 -15
  510. package/dist/ui-public/icons/regular/square-dashed.js +0 -15
  511. package/dist/ui-public/icons/regular/square-left.js +0 -16
  512. package/dist/ui-public/icons/regular/square-terminal.js +0 -16
  513. package/dist/ui-public/icons/regular/square-up-right.js +0 -16
  514. package/dist/ui-public/icons/regular/store.js +0 -16
  515. package/dist/ui-public/icons/regular/swap-arrows.js +0 -15
  516. package/dist/ui-public/icons/regular/table.js +0 -16
  517. package/dist/ui-public/icons/regular/tag.js +0 -16
  518. package/dist/ui-public/icons/regular/toggle-on.js +0 -15
  519. package/dist/ui-public/icons/regular/toolbox.js +0 -16
  520. package/dist/ui-public/icons/regular/trash-undo.js +0 -15
  521. package/dist/ui-public/icons/regular/trash.js +0 -16
  522. package/dist/ui-public/icons/regular/triangle-exclamation.js +0 -16
  523. package/dist/ui-public/icons/regular/turn-up.js +0 -16
  524. package/dist/ui-public/icons/regular/user-group.js +0 -15
  525. package/dist/ui-public/icons/regular/user-helmet-safety.js +0 -16
  526. package/dist/ui-public/icons/regular/user-lock.js +0 -16
  527. package/dist/ui-public/icons/regular/user-minus.js +0 -16
  528. package/dist/ui-public/icons/regular/user-tie.js +0 -15
  529. package/dist/ui-public/icons/regular/user.js +0 -16
  530. package/dist/ui-public/icons/regular/users.js +0 -15
  531. package/dist/ui-public/icons/regular/video.js +0 -15
  532. package/dist/ui-public/icons/regular/webhook.js +0 -15
  533. package/dist/ui-public/icons/regular/wrench.js +0 -15
  534. package/dist/ui-public/icons/regular/xmark.js +0 -16
  535. package/dist/ui-public/icons/solid/align-center.js +0 -16
  536. package/dist/ui-public/icons/solid/align-justify.js +0 -16
  537. package/dist/ui-public/icons/solid/align-left.js +0 -16
  538. package/dist/ui-public/icons/solid/align-right.js +0 -16
  539. package/dist/ui-public/icons/solid/arrow-rotate-left.js +0 -16
  540. package/dist/ui-public/icons/solid/arrow-rotate-right.js +0 -16
  541. package/dist/ui-public/icons/solid/bold.js +0 -16
  542. package/dist/ui-public/icons/solid/circle-exclamation.js +0 -16
  543. package/dist/ui-public/icons/solid/closed-captioning.js +0 -15
  544. package/dist/ui-public/icons/solid/code.js +0 -16
  545. package/dist/ui-public/icons/solid/compress.js +0 -16
  546. package/dist/ui-public/icons/solid/download.js +0 -15
  547. package/dist/ui-public/icons/solid/expand.js +0 -16
  548. package/dist/ui-public/icons/solid/file-arrow-down.js +0 -15
  549. package/dist/ui-public/icons/solid/file-code.js +0 -16
  550. package/dist/ui-public/icons/solid/grid-2.js +0 -16
  551. package/dist/ui-public/icons/solid/h1.js +0 -16
  552. package/dist/ui-public/icons/solid/h2.js +0 -16
  553. package/dist/ui-public/icons/solid/h3.js +0 -16
  554. package/dist/ui-public/icons/solid/h4.js +0 -16
  555. package/dist/ui-public/icons/solid/h5.js +0 -16
  556. package/dist/ui-public/icons/solid/h6.js +0 -16
  557. package/dist/ui-public/icons/solid/highlighter.js +0 -16
  558. package/dist/ui-public/icons/solid/horizontal-rule.js +0 -16
  559. package/dist/ui-public/icons/solid/image.js +0 -16
  560. package/dist/ui-public/icons/solid/indent.js +0 -16
  561. package/dist/ui-public/icons/solid/italic.js +0 -16
  562. package/dist/ui-public/icons/solid/link.js +0 -16
  563. package/dist/ui-public/icons/solid/list-ol.js +0 -16
  564. package/dist/ui-public/icons/solid/list-ul.js +0 -16
  565. package/dist/ui-public/icons/solid/location-dot.js +0 -16
  566. package/dist/ui-public/icons/solid/music.js +0 -15
  567. package/dist/ui-public/icons/solid/outdent.js +0 -16
  568. package/dist/ui-public/icons/solid/paragraph.js +0 -16
  569. package/dist/ui-public/icons/solid/plus.js +0 -16
  570. package/dist/ui-public/icons/solid/quote-right.js +0 -16
  571. package/dist/ui-public/icons/solid/rectangle-code.js +0 -16
  572. package/dist/ui-public/icons/solid/square-plus.js +0 -16
  573. package/dist/ui-public/icons/solid/strikethrough.js +0 -16
  574. package/dist/ui-public/icons/solid/subtitles.js +0 -15
  575. package/dist/ui-public/icons/solid/table.js +0 -16
  576. package/dist/ui-public/icons/solid/triangle-exclamation.js +0 -16
  577. package/dist/ui-public/icons/solid/underline.js +0 -16
@@ -0,0 +1,94 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type RecordRowImage } from './Image.js';
3
+ import List from './List.js';
4
+ import type { RecordRowItem, RecordRowModel, RecordRowPresentation } from './types.js';
5
+ export type { RecordRowImageProps } from './Image.js';
6
+ export type { RecordRowListProps } from './List.js';
7
+ export type { RecordRowImage, RecordRowItem, RecordRowModel, RecordRowPresentation, };
8
+ type Content =
9
+ /** The data of the record, already resolved */
10
+ {
11
+ /**
12
+ * The data of the record, for example a result of
13
+ * `ctx.loadItemPresentationInfo`
14
+ */
15
+ presentation: RecordRowPresentation;
16
+ /**
17
+ * The model of the record. The row shows its name above the title,
18
+ * and the status only when it has the draft mode. Without it, the row
19
+ * reads the model of `presentation.itemTypeId` from the host.
20
+ */
21
+ model?: RecordRowModel | null;
22
+ item?: never;
23
+ preferredLocale?: never;
24
+ }
25
+ /** The record: the row loads its data from the host */
26
+ | {
27
+ /**
28
+ * The ID of the record, or the record. The row loads its presentation
29
+ * once, and again when `item` changes: it does not show the changes
30
+ * that somebody makes to the record later. While it loads, it shows a
31
+ * placeholder in place of the title, and the model and the status of
32
+ * a full record.
33
+ */
34
+ item: string | RecordRowItem;
35
+ /** The locale of the title and of the image */
36
+ preferredLocale?: string;
37
+ presentation?: never;
38
+ model?: never;
39
+ };
40
+ type Layout = {
41
+ /**
42
+ * "row" shows the model above the title: a row of a list, an option
43
+ * of a menu.
44
+ */
45
+ layout: 'row';
46
+ /**
47
+ * More lines below the title, small and in the subtle ink. For example
48
+ * the parents of the record, or the users that edit it.
49
+ */
50
+ children?: ReactNode;
51
+ } | {
52
+ /**
53
+ * "inline" shows one line: a chip, the value of a select, a record in
54
+ * a text. It has no model and no lines below the title.
55
+ */
56
+ layout: 'inline';
57
+ children?: never;
58
+ };
59
+ type Common = {
60
+ /**
61
+ * Shows the ID of the record. For example when the ID matches the text of
62
+ * a search.
63
+ * @default false
64
+ */
65
+ showId?: boolean;
66
+ /**
67
+ * The title shows on up to three lines, not on one line. Only for a list
68
+ * of records that is wide enough.
69
+ * @default false
70
+ */
71
+ multilineTitle?: boolean;
72
+ /**
73
+ * The row ignores the `RecordRow.List` around it (for example a chip of a
74
+ * select, when the list is the options of the menu). It shows an image
75
+ * only when it has one, and does not change the rows.
76
+ * @default false
77
+ */
78
+ standalone?: boolean;
79
+ };
80
+ export type RecordRowProps = Content & Layout & Common;
81
+ /**
82
+ * A record in a row: the image, the model, the title, the validity
83
+ * triangles and the status, always in the same order and with the same
84
+ * sizes. It shows only the content: its container gives the surface, the
85
+ * hover and the click.
86
+ */
87
+ declare function RecordRow(props: RecordRowProps): React.JSX.Element;
88
+ declare const _default: React.NamedExoticComponent<RecordRowProps> & {
89
+ readonly type: typeof RecordRow;
90
+ } & {
91
+ Image: React.MemoExoticComponent<({ image }: import("./Image.js").RecordRowImageProps) => React.JSX.Element>;
92
+ List: typeof List;
93
+ };
94
+ export default _default;
@@ -0,0 +1,122 @@
1
+ import { useTranslation } from "../../i18n.js";
2
+ import { useLoadedRecordPresentation, useRecordPresentationModel } from "./presentation.js";
3
+ import { ItemValidityTriangles } from "../../content/ValidityTriangles.js";
4
+ import EntityRow_default from "../EntityRow.js";
5
+ import IdText from "../../content/IdText.js";
6
+ import ItemStatus_default from "../../content/ItemStatus.js";
7
+ import { useRecordRowImageSlot, useRecordRowsShowModel } from "./context.js";
8
+ import Image_default from "./Image.js";
9
+ import List from "./List.js";
10
+ import React, { useMemo } from "react";
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ //#region ../ui-public/src/lists/RecordRow/index.tsx
13
+ var imageSizes = {
14
+ inline: 20,
15
+ row: 32
16
+ };
17
+ function PresentedRecordRow({ presentation, model: givenModel, layout, showId = false, multilineTitle, standalone, children }) {
18
+ const { t, tc } = useTranslation();
19
+ const modelOf = useRecordPresentationModel();
20
+ const { id, image, title, status, itemTypeId } = presentation;
21
+ const model = givenModel !== void 0 ? givenModel : itemTypeId ? modelOf(itemTypeId) : null;
22
+ const showImage = useRecordRowImageSlot(Boolean(image), standalone);
23
+ const showModel = useRecordRowsShowModel() && Boolean(model);
24
+ const idShown = showId && Boolean(id);
25
+ const common = {
26
+ multilineTitle,
27
+ image: showImage && /* @__PURE__ */ jsx(Image_default, { image }),
28
+ title,
29
+ afterTitle: /* @__PURE__ */ jsx(ItemValidityTriangles, {
30
+ currentValid: presentation.currentVersionValid,
31
+ publishedValid: presentation.publishedVersionValid,
32
+ draftModeActive: model?.draftModeActive
33
+ }),
34
+ trailing: model?.draftModeActive && status ? /* @__PURE__ */ jsx(ItemStatus_default, { status }) : void 0
35
+ };
36
+ if (layout === "inline") return /* @__PURE__ */ jsx(EntityRow_default, {
37
+ layout: "inline",
38
+ ...common,
39
+ aside: idShown && id ? /* @__PURE__ */ jsx(IdText, {
40
+ id,
41
+ labeled: true
42
+ }) : void 0
43
+ });
44
+ return /* @__PURE__ */ jsx(EntityRow_default, {
45
+ layout: "row",
46
+ ...common,
47
+ kicker: showModel || idShown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
48
+ showModel && model && tc(model.name),
49
+ showModel && idShown && " ",
50
+ idShown && id && /* @__PURE__ */ jsxs(Fragment$1, { children: [!showModel && `${t("idText.label")} `, /* @__PURE__ */ jsx(IdText, {
51
+ id,
52
+ labeled: showModel
53
+ })] })
54
+ ] }) : void 0,
55
+ children
56
+ });
57
+ }
58
+ function LoadingTitle() {
59
+ const { t } = useTranslation();
60
+ return /* @__PURE__ */ jsx("span", {
61
+ className: "RecordRow__loading",
62
+ "aria-busy": "true",
63
+ children: /* @__PURE__ */ jsx("span", {
64
+ className: "visually-hidden",
65
+ children: t("recordRow.loading")
66
+ })
67
+ });
68
+ }
69
+ function LoadedRecordRow({ item, preferredLocale, ...rest }) {
70
+ const { t } = useTranslation();
71
+ const size = imageSizes[rest.layout];
72
+ const options = useMemo(() => ({
73
+ preferredLocale,
74
+ preferredImageSize: {
75
+ width: size,
76
+ height: size
77
+ }
78
+ }), [preferredLocale, size]);
79
+ const loaded = useLoadedRecordPresentation(item, options);
80
+ const fullItem = typeof item === "string" ? null : item;
81
+ const id = typeof item === "string" ? item : item.id;
82
+ const presentation = loaded ? {
83
+ ...loaded,
84
+ id
85
+ } : {
86
+ id,
87
+ title: loaded === null ? t("recordRow.fallbackTitle", { id }) : /* @__PURE__ */ jsx(LoadingTitle, {}),
88
+ image: null,
89
+ itemTypeId: fullItem?.relationships.item_type.data.id,
90
+ status: fullItem ? fullItem.meta.status ?? "published" : void 0,
91
+ currentVersionValid: fullItem?.meta.is_current_version_valid ?? void 0,
92
+ publishedVersionValid: fullItem?.meta.is_published_version_valid ?? void 0
93
+ };
94
+ return /* @__PURE__ */ jsx(PresentedRecordRow, {
95
+ ...rest,
96
+ presentation
97
+ });
98
+ }
99
+ /**
100
+ * A record in a row: the image, the model, the title, the validity
101
+ * triangles and the status, always in the same order and with the same
102
+ * sizes. It shows only the content: its container gives the surface, the
103
+ * hover and the click.
104
+ */
105
+ function RecordRow(props) {
106
+ if (props.item !== void 0) return /* @__PURE__ */ jsx(LoadedRecordRow, {
107
+ ...props,
108
+ item: props.item
109
+ });
110
+ const { presentation, model, ...rest } = props;
111
+ return /* @__PURE__ */ jsx(PresentedRecordRow, {
112
+ ...rest,
113
+ presentation,
114
+ model
115
+ });
116
+ }
117
+ var RecordRow_default = Object.assign(React.memo(RecordRow), {
118
+ Image: Image_default,
119
+ List
120
+ });
121
+ //#endregion
122
+ export { RecordRow_default as default };
@@ -0,0 +1,73 @@
1
+ import { createTickBatcher } from "../../utils/tickBatcher.js";
2
+ import { createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region ../ui-public/src/lists/RecordRow/presentation.tsx
5
+ var RecordPresentationContext = createContext({
6
+ request: async () => null,
7
+ model: () => null
8
+ });
9
+ function optionsKey(options) {
10
+ return JSON.stringify([
11
+ options.preferredLocale ?? null,
12
+ options.preferredImageSize?.width ?? null,
13
+ options.preferredImageSize?.height ?? null
14
+ ]);
15
+ }
16
+ /**
17
+ * Gives the loader of the presentation of records to the `RecordRow`s with
18
+ * `item`. The rows of one render ask for their records in the same tick:
19
+ * the provider sends them in one call to the loader, one call for each set
20
+ * of options. It keeps no cache, so a row that renders again with a new
21
+ * record asks again. A failed call gives null to its rows.
22
+ */
23
+ function RecordPresentationProvider({ load, model, children }) {
24
+ const value = useMemo(() => ({
25
+ model,
26
+ request: createTickBatcher({
27
+ groupKey: optionsKey,
28
+ fallback: null,
29
+ load: async (options, itemsOrIds) => load ? load(itemsOrIds, options) : itemsOrIds.map(() => null)
30
+ })
31
+ }), [load, model]);
32
+ return /* @__PURE__ */ jsx(RecordPresentationContext.Provider, {
33
+ value,
34
+ children
35
+ });
36
+ }
37
+ function useRecordPresentationModel() {
38
+ return useContext(RecordPresentationContext).model;
39
+ }
40
+ /**
41
+ * The presentation of a record from the loader of the provider. It is
42
+ * undefined while it loads, and null when the record does not exist or the
43
+ * loader failed. It loads again when the record changes, not when the record
44
+ * changes on the server.
45
+ */
46
+ function useLoadedRecordPresentation(itemOrId, options) {
47
+ const { request } = useContext(RecordPresentationContext);
48
+ const [state, setState] = useState(null);
49
+ const key = `${typeof itemOrId === "string" ? itemOrId : JSON.stringify(itemOrId)}|${optionsKey(options)}`;
50
+ const latest = useRef({
51
+ itemOrId,
52
+ options
53
+ });
54
+ latest.current = {
55
+ itemOrId,
56
+ options
57
+ };
58
+ useEffect(() => {
59
+ let active = true;
60
+ request(latest.current.options, latest.current.itemOrId).then((value) => {
61
+ if (active) setState({
62
+ key,
63
+ value
64
+ });
65
+ });
66
+ return () => {
67
+ active = false;
68
+ };
69
+ }, [request, key]);
70
+ return state?.key === key ? state.value : void 0;
71
+ }
72
+ //#endregion
73
+ export { RecordPresentationProvider, useLoadedRecordPresentation, useRecordPresentationModel };
@@ -0,0 +1,58 @@
1
+ import type { Message } from '../../Message.js';
2
+ import type { RecordRowImage } from './Image.js';
3
+ /**
4
+ * The data of a record that the row shows. A result of
5
+ * `ctx.loadItemPresentationInfo` is a `RecordRowPresentation`.
6
+ */
7
+ export type RecordRowPresentation = {
8
+ /**
9
+ * The ID of the record. A block that is not saved yet has no ID. The row
10
+ * shows it only with `showId`.
11
+ */
12
+ id?: string;
13
+ /** The title of the record */
14
+ title: Message;
15
+ /** The image of the record, or null when the record has no image */
16
+ image: RecordRowImage | null;
17
+ /**
18
+ * The ID of the model of the record. Without `model`, the row reads the
19
+ * model from the host with this ID.
20
+ */
21
+ itemTypeId?: string;
22
+ /**
23
+ * The publishing status of the record. The row shows it only when the
24
+ * model has the draft mode: without it, a record is published every time
25
+ * that it is saved, and the status says nothing.
26
+ */
27
+ status?: 'draft' | 'updated' | 'published';
28
+ /** False when the current version of the record does not pass the validations */
29
+ currentVersionValid?: boolean;
30
+ /** False when the published version of the record does not pass the validations */
31
+ publishedVersionValid?: boolean;
32
+ };
33
+ /** The model of the record */
34
+ export type RecordRowModel = {
35
+ /** The name of the model, with its emoji */
36
+ name: Message;
37
+ /** True when the model has the draft mode */
38
+ draftModeActive: boolean;
39
+ };
40
+ /**
41
+ * A record as the API gives it. The row reads only these fields, for the
42
+ * model, the status and the validity while the presentation loads.
43
+ */
44
+ export type RecordRowItem = {
45
+ id: string;
46
+ relationships: {
47
+ item_type: {
48
+ data: {
49
+ id: string;
50
+ };
51
+ };
52
+ };
53
+ meta: {
54
+ status?: 'draft' | 'updated' | 'published' | null;
55
+ is_current_version_valid?: boolean | null;
56
+ is_published_version_valid?: boolean | null;
57
+ };
58
+ };
@@ -10,7 +10,7 @@ export type RowListProps = {
10
10
  * @default "default"
11
11
  */
12
12
  density?: 'default' | 'compact';
13
- /** Only for the place of the list in its container (a margin), not for its look */
13
+ /** Only for the position of the list in its container (a margin), not for its look */
14
14
  className?: string;
15
15
  /** The rows (RowList.Item) */
16
16
  children: ReactNode;
@@ -21,9 +21,9 @@ export type RowListProps = {
21
21
  * of a section, use NavList: it adds the navigation landmark.
22
22
  */
23
23
  declare function BaseRowList({ density, className, children, }: RowListProps): React.JSX.Element;
24
- /** The row opens a page of the app. It is selected while the page is open. */
24
+ /** The row opens a page of DatoCMS. It is selected while the page is open. */
25
25
  type LinkRow = {
26
- /** The page of the app: the path with its query */
26
+ /** The page of DatoCMS: the path with its query */
27
27
  to: string;
28
28
  /** Runs on a click, before the page opens */
29
29
  onClick?: () => void;
@@ -53,13 +53,13 @@ export type RowListItemProps = RowListItemAction & {
53
53
  /**
54
54
  * The text of the row is subtle and its images fade, but the user can
55
55
  * still open it. Use it for an element that is off (for example a
56
- * disabled plugin), with a Pill that tells it.
56
+ * disabled plugin), with a Pill that says it.
57
57
  * @default false
58
58
  */
59
59
  muted?: boolean;
60
60
  /**
61
61
  * The user can drag the row to a new position. Give the argument of the
62
- * children of SortableItem (ui-public/dnd), with `handle` on the SortableItem:
62
+ * children of SortableItem , with `handle` on the SortableItem:
63
63
  * the row shows a grip at its left.
64
64
  */
65
65
  sortable?: SortableItemApi;
@@ -14,7 +14,7 @@ export type SettingsListRowProps = {
14
14
  /**
15
15
  * The current value. A long value gets an ellipsis (in a narrow list, it
16
16
  * goes on more lines), and a value on more lines (an address) has each
17
- * line at the right. An action without a value (for example "Log out
17
+ * line on the right. An action without a value (for example "Log out
18
18
  * everywhere") has no value.
19
19
  */
20
20
  value?: ReactNode;
@@ -25,11 +25,11 @@ export type SettingsListRowProps = {
25
25
  */
26
26
  action?: ReactNode;
27
27
  };
28
- /** A setting or an action: the text at the left, the value and the control at the right */
28
+ /** A setting or an action: the text on the left, the value and the control on the right */
29
29
  declare function Row({ title, description, value, action }: SettingsListRowProps): React.JSX.Element;
30
30
  /**
31
31
  * The settings of a wide page: one row for each value that the user changes
32
- * or for each action, with the control always visible at the right. Put it
32
+ * or for each action, with the control always visible on the right. Put it
33
33
  * in a Page.Group. For facts to read, use InfoList. For a list of items,
34
34
  * use CardList.
35
35
  */
@@ -9,7 +9,7 @@ function BaseSettingsList({ className, children }) {
9
9
  children
10
10
  });
11
11
  }
12
- /** A setting or an action: the text at the left, the value and the control at the right */
12
+ /** A setting or an action: the text on the left, the value and the control on the right */
13
13
  function Row({ title, description, value, action }) {
14
14
  const { tc } = useTranslation();
15
15
  return /* @__PURE__ */ jsxs("li", {
@@ -38,7 +38,7 @@ function Row({ title, description, value, action }) {
38
38
  }
39
39
  /**
40
40
  * The settings of a wide page: one row for each value that the user changes
41
- * or for each action, with the control always visible at the right. Put it
41
+ * or for each action, with the control always visible on the right. Put it
42
42
  * in a Page.Group. For facts to read, use InfoList. For a list of items,
43
43
  * use CardList.
44
44
  */
@@ -45,7 +45,7 @@ export type RowAction = {
45
45
  openWithArrows?: never;
46
46
  };
47
47
  /**
48
- * The drag handle at the left of the row: the handle that the library listens
48
+ * The drag handle on the left of the row: the handle that the library listens
49
49
  * to, or a disabled handle with the reason in a tooltip
50
50
  */
51
51
  export type RowDragHandle =
@@ -61,7 +61,7 @@ export type RowDragHandle =
61
61
  };
62
62
  export type RowDrag = {
63
63
  /**
64
- * The element that the library moves. It has a position, thus the drop
64
+ * The element that the library moves. It has a position, so the drop
65
65
  * indicator can be in it.
66
66
  */
67
67
  wrapperRef?: Ref<HTMLDivElement>;
@@ -91,7 +91,7 @@ type RowBaseProps<R> = {
91
91
  /**
92
92
  * The text of the row is subtle and its images fade, but the user can
93
93
  * still open it. Use it for an element that is off (for example a
94
- * deactivated user), with a Pill that tells it.
94
+ * deactivated user), with a Pill that says it.
95
95
  * @default false
96
96
  */
97
97
  muted?: boolean;
@@ -99,7 +99,7 @@ type RowBaseProps<R> = {
99
99
  /** The element of the row, without the handle */
100
100
  rowRef?: Ref<HTMLDivElement>;
101
101
  /**
102
- * The actions of the row (see `ui-public/Actions`): their keys work while the
102
+ * The actions of the row (see `Actions`): their keys work while the
103
103
  * pointer or the focus is in the row, and a menu in the row runs them.
104
104
  */
105
105
  actions?: readonly Action[];
@@ -117,7 +117,7 @@ type RowBaseProps<R> = {
117
117
  * device with no hover. A click in them never opens the row.
118
118
  */
119
119
  trailing?: ReactNode;
120
- /** Cells in place of the cells of the columns. Use <Table.Cell>. */
120
+ /** Cells instead of the cells of the columns. Use <Table.Cell>. */
121
121
  children?: ReactNode;
122
122
  };
123
123
  export type RowProps<R = any> = RowBaseProps<R> & RowAction;
@@ -18,7 +18,7 @@ export type TableProps<R = any> = {
18
18
  layout: TableLayout;
19
19
  onLayoutChange: (layout: TableLayout) => void;
20
20
  /**
21
- * The order of the rows: `useClientSort` or a hook of the app gives it.
21
+ * The order of the rows: `useClientSort` or a hook of yours gives it.
22
22
  * Without it, the user cannot sort from the header.
23
23
  */
24
24
  sort?: TableSortState;
@@ -30,13 +30,13 @@ export type TableProps<R = any> = {
30
30
  /**
31
31
  * The width in pixels of a column at the end of each row, outside the columns
32
32
  * of the layout and with no label: the controls of the row (see `trailing` of
33
- * <Table.Row>). The header keeps the same space empty, thus the button of the
33
+ * <Table.Row>). The header keeps the same space empty, so the button of the
34
34
  * columns menu sits over it.
35
35
  */
36
36
  trailingWidth?: number;
37
37
  /**
38
38
  * The rows have a drag handle at their left. Set it with the `reorder` of
39
- * <Table.Body>, or for rows that a library of the caller moves (a tree).
39
+ * <Table.Body>, or for rows that a library of yours moves (a tree).
40
40
  */
41
41
  reorderable?: boolean;
42
42
  /**
@@ -7,7 +7,7 @@ export type TableRowExpandable = {
7
7
  /** Runs when the user clicks the toggle */
8
8
  onToggle: () => void;
9
9
  /**
10
- * The child rows load: a spinner takes the place of the chevron, and the
10
+ * The child rows load: a spinner replaces the chevron, and the
11
11
  * toggle does nothing
12
12
  */
13
13
  busy?: boolean;
@@ -19,7 +19,7 @@ export type TableRowExpandable = {
19
19
  };
20
20
  /**
21
21
  * The toggle column of a tree row. A row without child rows keeps the space
22
- * of the toggle, thus the contents of the rows align.
22
+ * of the toggle, so the contents of the rows align.
23
23
  */
24
24
  export declare function TreeToggle({ expandable, nested, labelledBy, }: {
25
25
  expandable: TableRowExpandable | undefined;
@@ -11,7 +11,7 @@ function stopPropagation(event) {
11
11
  }
12
12
  /**
13
13
  * The toggle column of a tree row. A row without child rows keeps the space
14
- * of the toggle, thus the contents of the rows align.
14
+ * of the toggle, so the contents of the rows align.
15
15
  */
16
16
  function TreeToggle({ expandable, nested, labelledBy }) {
17
17
  if (!expandable) return /* @__PURE__ */ jsx(TreeToggleSlot, { children: nested ? /* @__PURE__ */ jsx(Generic.DashIcon, { className: "Table__toggle__dash" }) : /* @__PURE__ */ jsx(DisclosureChevronPlaceholder, {}) });
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  export type LinkCellProps = {
3
3
  /** The path of the link */
4
4
  to: string;
5
- /** The text of the link: a string, thus the title can show it */
5
+ /** The text of the link: a string, so the title can show it */
6
6
  children: string;
7
7
  };
8
8
  /** A link in a cell. The title shows the full text when the column cuts it. */
@@ -13,7 +13,7 @@ export type TreeRowActionProps = {
13
13
  };
14
14
  /**
15
15
  * The content of a `TreeRow` as a button, for example "Load more". The
16
- * button starts in the column of the handle, thus a click there also runs
16
+ * button starts in the column of the handle, so a click there also runs
17
17
  * it. Give it to a row with no `expandable` and no `drag.handle`. In a
18
18
  * SortableTree, the button is a tree item: the arrow keys move the focus to
19
19
  * it, and Enter or Space runs it.
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region ../ui-public/src/lists/TreeRow/Action.tsx
7
7
  /**
8
8
  * The content of a `TreeRow` as a button, for example "Load more". The
9
- * button starts in the column of the handle, thus a click there also runs
9
+ * button starts in the column of the handle, so a click there also runs
10
10
  * it. Give it to a row with no `expandable` and no `drag.handle`. In a
11
11
  * SortableTree, the button is a tree item: the arrow keys move the focus to
12
12
  * it, and Enter or Space runs it.
@@ -6,7 +6,7 @@ export type TreeRowLinkProps = Omit<LinkProps, 'className' | 'children'> & {
6
6
  };
7
7
  /**
8
8
  * The content of a `TreeRow` as a link, for example the link that opens a
9
- * record. Give it the `provided.treeItemProps` of SortableTree, thus the
9
+ * record. Give it the `provided.treeItemProps` of SortableTree, so the
10
10
  * arrow keys move the focus between the rows.
11
11
  */
12
12
  export default function TreeRowLink({ children, ...props }: TreeRowLinkProps): React.JSX.Element;
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
4
4
  //#region ../ui-public/src/lists/TreeRow/Link.tsx
5
5
  /**
6
6
  * The content of a `TreeRow` as a link, for example the link that opens a
7
- * record. Give it the `provided.treeItemProps` of SortableTree, thus the
7
+ * record. Give it the `provided.treeItemProps` of SortableTree, so the
8
8
  * arrow keys move the focus between the rows.
9
9
  */
10
10
  function TreeRowLink({ children, ...props }) {