@fibery/ui-kit 1.35.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc +14 -0
  3. package/CHANGELOG.md +586 -0
  4. package/babel.config.js +3 -0
  5. package/config/jest/testFrameworkSetup.js +1 -0
  6. package/package.json +6 -40
  7. package/scripts/generate-icons.mjs +116 -0
  8. package/src/__mocks__/createInlineTheme.js +3 -0
  9. package/src/__mocks__/styleMock.js +1 -0
  10. package/src/a11y-color.ts +1 -1
  11. package/src/action-badge.tsx +63 -0
  12. package/src/actions-panel.tsx +50 -0
  13. package/src/ai/max-tokens.tsx +42 -0
  14. package/src/ai/model.tsx +79 -0
  15. package/src/ai/temperature.tsx +75 -0
  16. package/src/animated-height-container.tsx +82 -0
  17. package/src/animated-number.tsx +38 -0
  18. package/src/animations.tsx +62 -0
  19. package/src/antd/AutoComplete.d.ts +1 -0
  20. package/src/antd/AutoComplete.js +34 -0
  21. package/src/antd/Tabs.d.ts +5 -0
  22. package/src/antd/Tabs.js +58 -0
  23. package/src/antd/ant-modal.tsx +11 -0
  24. package/src/antd/ant-upload.tsx +73 -0
  25. package/src/antd/auto-width-transparent-textarea.tsx +56 -0
  26. package/src/antd/get-wrapper.tsx +11 -0
  27. package/src/antd/index.tsx +4 -0
  28. package/src/antd/input-number.tsx +51 -0
  29. package/src/antd/input.tsx +56 -0
  30. package/src/antd/utils.tsx +43 -0
  31. package/src/app-icon-with-fallback.tsx +147 -0
  32. package/src/app-icon-wrapper.tsx +44 -0
  33. package/src/app-icon.tsx +52 -0
  34. package/src/app-mode.tsx +52 -0
  35. package/src/appIcons.json +13066 -0
  36. package/src/avatar.tsx +262 -0
  37. package/src/axis-header.tsx +160 -0
  38. package/src/badge.tsx +39 -0
  39. package/src/board-table-loader.tsx +106 -0
  40. package/src/box.tsx +444 -0
  41. package/src/breakpoints.tsx +59 -0
  42. package/src/card-container.tsx +483 -0
  43. package/src/checkbox-multi-select.tsx +71 -0
  44. package/src/checkbox.tsx +232 -0
  45. package/src/collapsible/index.tsx +43 -0
  46. package/src/collapsible-section.tsx +69 -0
  47. package/src/color-picker/ColorPickerOrLoader.js +23 -0
  48. package/src/color-picker/SliderPointer.js +14 -0
  49. package/src/color-picker/index.js +118 -0
  50. package/src/color-picker/swatch.tsx +85 -0
  51. package/src/command-menu/index.tsx +176 -0
  52. package/src/comment.tsx +218 -0
  53. package/src/context-menu/index.tsx +134 -0
  54. package/src/copy-to-clipboard.ts +1 -0
  55. package/src/country-selector.tsx +29 -0
  56. package/src/date-picker/autocomplete.tsx +74 -0
  57. package/src/date-picker/constants.ts +3 -0
  58. package/src/date-picker/contexts.ts +7 -0
  59. package/src/date-picker/date-range-input.tsx +346 -0
  60. package/src/date-picker/date-range-picker-popup-content.tsx +190 -0
  61. package/src/date-picker/date-range-picker.tsx +124 -0
  62. package/src/date-picker/day-with-start-end-buttons.tsx +171 -0
  63. package/src/date-picker/fake-date-input.tsx +40 -0
  64. package/src/date-picker/get-weekends-for-month.ts +7 -0
  65. package/src/date-picker/rc-input-types.ts +11 -0
  66. package/src/date-picker/relative-date-picker.tsx +141 -0
  67. package/src/date-picker/single-date-input.tsx +239 -0
  68. package/src/date-picker/single-date-picker-popup-content.tsx +90 -0
  69. package/src/date-picker/single-date-picker.tsx +243 -0
  70. package/src/date-picker/styles.ts +262 -0
  71. package/src/date-picker/types.ts +56 -0
  72. package/src/date-picker/utils.ts +110 -0
  73. package/src/date-picker/with-popup-control.tsx +61 -0
  74. package/src/day-select/day-select.tsx +94 -0
  75. package/src/day-select/iso-week-day-select.tsx +15 -0
  76. package/src/day-select/mount-day-select.tsx +11 -0
  77. package/src/day-select/week-day-select.test.tsx +48 -0
  78. package/src/day-select/week-day-select.tsx +42 -0
  79. package/src/delayed.tsx +26 -0
  80. package/src/design-system.test.ts +24 -0
  81. package/src/design-system.ts +23 -9
  82. package/src/dnd.tsx +55 -0
  83. package/src/emoji.tsx +30 -0
  84. package/src/empty-state/empty-state-action.tsx +3 -0
  85. package/src/empty-state/empty-state-emoji.tsx +20 -0
  86. package/src/empty-state/empty-state.tsx +80 -0
  87. package/src/empty-value.tsx +21 -0
  88. package/src/errors.ts +29 -0
  89. package/src/favorites-icon.tsx +87 -0
  90. package/src/features.tsx +10 -0
  91. package/src/fibermoji-placeholder.tsx +180 -0
  92. package/src/field-container.tsx +213 -0
  93. package/src/file-item.tsx +151 -0
  94. package/src/form-utils.ts +7 -0
  95. package/src/format-date-from-now.ts +33 -0
  96. package/src/full-fibery-logo.tsx +26 -0
  97. package/src/get-trigger-node-popup-container.ts +7 -0
  98. package/src/guide-link.tsx +24 -0
  99. package/src/header-layout.tsx +33 -0
  100. package/src/hint.tsx +47 -0
  101. package/src/hoverable-via-display.tsx +29 -0
  102. package/src/hoverable.tsx +53 -0
  103. package/src/html-styles.ts +720 -0
  104. package/src/icons/ast/AccessTemplate.ts +8 -0
  105. package/src/icons/ast/Asterisk.ts +8 -0
  106. package/src/icons/ast/Copy.ts +1 -1
  107. package/src/icons/ast/CrossCircle.ts +8 -0
  108. package/src/icons/ast/Duplicate.ts +1 -1
  109. package/src/icons/ast/Gift.ts +1 -1
  110. package/src/icons/ast/LevelPlus.ts +8 -0
  111. package/src/icons/ast/ResetPassword.ts +8 -0
  112. package/src/icons/ast/ViewGantt.ts +8 -0
  113. package/src/icons/ast/index.tsx +6 -0
  114. package/src/icons/react/AccessTemplate.tsx +13 -0
  115. package/src/icons/react/Asterisk.tsx +13 -0
  116. package/src/icons/react/CrossCircle.tsx +13 -0
  117. package/src/icons/react/LevelPlus.tsx +13 -0
  118. package/src/icons/react/ResetPassword.tsx +13 -0
  119. package/src/icons/react/ViewGantt.tsx +13 -0
  120. package/src/icons/react/index.tsx +6 -0
  121. package/src/icons/svg/abort.svg +3 -0
  122. package/src/icons/svg/access-template.svg +4 -0
  123. package/src/icons/svg/activity-log.svg +4 -0
  124. package/src/icons/svg/activity.svg +4 -0
  125. package/src/icons/svg/add-after.svg +4 -0
  126. package/src/icons/svg/add-before.svg +4 -0
  127. package/src/icons/svg/add-compact.svg +2 -0
  128. package/src/icons/svg/add-database.svg +3 -0
  129. package/src/icons/svg/add-group.svg +4 -0
  130. package/src/icons/svg/add-integration.svg +3 -0
  131. package/src/icons/svg/add-reactions.svg +8 -0
  132. package/src/icons/svg/add.svg +2 -0
  133. package/src/icons/svg/ai-assistant.svg +3 -0
  134. package/src/icons/svg/ai-avatar.svg +3 -0
  135. package/src/icons/svg/ai-search.svg +3 -0
  136. package/src/icons/svg/alert-triangle.svg +3 -0
  137. package/src/icons/svg/app-details.svg +7 -0
  138. package/src/icons/svg/app-store-one-color.svg +4 -0
  139. package/src/icons/svg/app-store.svg +4 -0
  140. package/src/icons/svg/app-templates.svg +7 -0
  141. package/src/icons/svg/app-webhooks.svg +2 -0
  142. package/src/icons/svg/app-wiki.svg +2 -0
  143. package/src/icons/svg/app.svg +2 -0
  144. package/src/icons/svg/appearance-auto.svg +3 -0
  145. package/src/icons/svg/appearance-dark.svg +3 -0
  146. package/src/icons/svg/appearance-light.svg +3 -0
  147. package/src/icons/svg/arrow-bar-left.svg +4 -0
  148. package/src/icons/svg/arrow-bar-right.svg +4 -0
  149. package/src/icons/svg/arrow-bottom.svg +3 -0
  150. package/src/icons/svg/arrow-collapse-vertical.svg +3 -0
  151. package/src/icons/svg/arrow-collapse.svg +3 -0
  152. package/src/icons/svg/arrow-forward.svg +3 -0
  153. package/src/icons/svg/arrow-left.svg +3 -0
  154. package/src/icons/svg/arrow-right.svg +3 -0
  155. package/src/icons/svg/arrow-top.svg +3 -0
  156. package/src/icons/svg/arrow-up-circle.svg +4 -0
  157. package/src/icons/svg/arrows-right-left.svg +3 -0
  158. package/src/icons/svg/ask-for-input.svg +6 -0
  159. package/src/icons/svg/asterisk.svg +3 -0
  160. package/src/icons/svg/atom.svg +4 -0
  161. package/src/icons/svg/automations-cancelled.svg +3 -0
  162. package/src/icons/svg/automations-disabled.svg +3 -0
  163. package/src/icons/svg/automations-error.svg +3 -0
  164. package/src/icons/svg/automations-in-progress.svg +3 -0
  165. package/src/icons/svg/automations-not-started.svg +3 -0
  166. package/src/icons/svg/automations-success.svg +3 -0
  167. package/src/icons/svg/back.svg +2 -0
  168. package/src/icons/svg/backlog-icon.svg +3 -0
  169. package/src/icons/svg/batch-actions-icon.svg +4 -0
  170. package/src/icons/svg/bell-circle.svg +4 -0
  171. package/src/icons/svg/bell-filled.svg +4 -0
  172. package/src/icons/svg/bell-off.svg +4 -0
  173. package/src/icons/svg/bell-ringing.svg +5 -0
  174. package/src/icons/svg/bell-x.svg +4 -0
  175. package/src/icons/svg/bolt.svg +3 -0
  176. package/src/icons/svg/bring-forward.svg +8 -0
  177. package/src/icons/svg/bring-to-front.svg +3 -0
  178. package/src/icons/svg/cards.svg +3 -0
  179. package/src/icons/svg/chat-ai.svg +5 -0
  180. package/src/icons/svg/chat.svg +3 -0
  181. package/src/icons/svg/check-circle-filled.svg +3 -0
  182. package/src/icons/svg/check-circle.svg +4 -0
  183. package/src/icons/svg/checked.svg +3 -0
  184. package/src/icons/svg/clean.svg +6 -0
  185. package/src/icons/svg/clear-input-filled.svg +3 -0
  186. package/src/icons/svg/clear-value.svg +6 -0
  187. package/src/icons/svg/clear.svg +6 -0
  188. package/src/icons/svg/clock-alarm.svg +6 -0
  189. package/src/icons/svg/clock-forward.svg +3 -0
  190. package/src/icons/svg/clock.svg +4 -0
  191. package/src/icons/svg/close.svg +4 -0
  192. package/src/icons/svg/collapse-all.svg +3 -0
  193. package/src/icons/svg/color-coding-filled.svg +3 -0
  194. package/src/icons/svg/color-coding.svg +4 -0
  195. package/src/icons/svg/columns-2.svg +3 -0
  196. package/src/icons/svg/columns-4.svg +3 -0
  197. package/src/icons/svg/columns.svg +3 -0
  198. package/src/icons/svg/comment-bubble.svg +3 -0
  199. package/src/icons/svg/copy.svg +5 -0
  200. package/src/icons/svg/create.svg +3 -0
  201. package/src/icons/svg/credits-filled.svg +3 -0
  202. package/src/icons/svg/cross-circle.svg +4 -0
  203. package/src/icons/svg/database-off.svg +3 -0
  204. package/src/icons/svg/database-stroke.svg +4 -0
  205. package/src/icons/svg/database.svg +4 -0
  206. package/src/icons/svg/delete.svg +6 -0
  207. package/src/icons/svg/demo.svg +2 -0
  208. package/src/icons/svg/dependency.svg +3 -0
  209. package/src/icons/svg/double-arrow-left.svg +2 -0
  210. package/src/icons/svg/double-arrow-right.svg +2 -0
  211. package/src/icons/svg/drag-block-handle-single.svg +5 -0
  212. package/src/icons/svg/drag-block-handle.svg +8 -0
  213. package/src/icons/svg/drag-handle.svg +2 -0
  214. package/src/icons/svg/duplicate.svg +5 -0
  215. package/src/icons/svg/dynamic-filter-value.svg +3 -0
  216. package/src/icons/svg/edit-value.svg +5 -0
  217. package/src/icons/svg/email.svg +3 -0
  218. package/src/icons/svg/emoji-delete.svg +5 -0
  219. package/src/icons/svg/entity-merge.svg +3 -0
  220. package/src/icons/svg/equation.svg +4 -0
  221. package/src/icons/svg/export.svg +4 -0
  222. package/src/icons/svg/extension/assignments.svg +7 -0
  223. package/src/icons/svg/extension/avatar.svg +2 -0
  224. package/src/icons/svg/extension/comments.svg +5 -0
  225. package/src/icons/svg/extension/files.svg +2 -0
  226. package/src/icons/svg/extension/references.svg +2 -0
  227. package/src/icons/svg/extension/workflow.svg +2 -0
  228. package/src/icons/svg/eye.svg +4 -0
  229. package/src/icons/svg/favorites-checked.svg +4 -0
  230. package/src/icons/svg/favorites-off.svg +4 -0
  231. package/src/icons/svg/favorites.svg +4 -0
  232. package/src/icons/svg/fibery-mono.svg +3 -0
  233. package/src/icons/svg/field-unit.svg +3 -0
  234. package/src/icons/svg/fields.svg +4 -0
  235. package/src/icons/svg/figma.svg +7 -0
  236. package/src/icons/svg/file-upload.svg +7 -0
  237. package/src/icons/svg/filter.svg +3 -0
  238. package/src/icons/svg/fit-to-screen.svg +5 -0
  239. package/src/icons/svg/focus-mode-off.svg +5 -0
  240. package/src/icons/svg/focus-mode.svg +5 -0
  241. package/src/icons/svg/folder.svg +4 -0
  242. package/src/icons/svg/form-with-cover.svg +7 -0
  243. package/src/icons/svg/form-without-cover.svg +6 -0
  244. package/src/icons/svg/fullscreen-mode-off-icon.svg +3 -0
  245. package/src/icons/svg/fullscreen-mode-on-icon.svg +3 -0
  246. package/src/icons/svg/fullscreen-mode-on.svg +4 -0
  247. package/src/icons/svg/gift.svg +3 -0
  248. package/src/icons/svg/github.svg +1 -0
  249. package/src/icons/svg/gitlab.svg +3 -0
  250. package/src/icons/svg/globe-simple.svg +3 -0
  251. package/src/icons/svg/globe.svg +3 -0
  252. package/src/icons/svg/go-to.svg +5 -0
  253. package/src/icons/svg/google-drive.svg +8 -0
  254. package/src/icons/svg/google-map.svg +7 -0
  255. package/src/icons/svg/headphones-ai.svg +4 -0
  256. package/src/icons/svg/headphones.svg +3 -0
  257. package/src/icons/svg/hide.svg +2 -0
  258. package/src/icons/svg/highlights.svg +3 -0
  259. package/src/icons/svg/hint.svg +4 -0
  260. package/src/icons/svg/home.svg +2 -0
  261. package/src/icons/svg/image-xmark.svg +2 -0
  262. package/src/icons/svg/import.svg +4 -0
  263. package/src/icons/svg/info-circle-filled.svg +3 -0
  264. package/src/icons/svg/info-circle.svg +6 -0
  265. package/src/icons/svg/integration.svg +2 -0
  266. package/src/icons/svg/integrations/integration-discourse-color.svg +8 -0
  267. package/src/icons/svg/integrations/integration-intercom-color.svg +3 -0
  268. package/src/icons/svg/integrations/integration-slack-color.svg +10 -0
  269. package/src/icons/svg/integrations/integration-zendesk-color.svg +6 -0
  270. package/src/icons/svg/invite-people.svg +6 -0
  271. package/src/icons/svg/items-timeline.svg +4 -0
  272. package/src/icons/svg/items.svg +3 -0
  273. package/src/icons/svg/jira.svg +3 -0
  274. package/src/icons/svg/key.svg +4 -0
  275. package/src/icons/svg/lab.svg +6 -0
  276. package/src/icons/svg/layout-double.svg +3 -0
  277. package/src/icons/svg/layout-single.svg +3 -0
  278. package/src/icons/svg/left-panel.svg +11 -0
  279. package/src/icons/svg/level-plus.svg +4 -0
  280. package/src/icons/svg/levels.svg +2 -0
  281. package/src/icons/svg/line-divider.svg +3 -0
  282. package/src/icons/svg/link.svg +6 -0
  283. package/src/icons/svg/lock-outline.svg +5 -0
  284. package/src/icons/svg/lock.svg +4 -0
  285. package/src/icons/svg/logout.svg +4 -0
  286. package/src/icons/svg/loom.svg +3 -0
  287. package/src/icons/svg/loupe-zoom-in.svg +3 -0
  288. package/src/icons/svg/loupe-zoom-out.svg +1 -0
  289. package/src/icons/svg/loupe-zoom.svg +3 -0
  290. package/src/icons/svg/many-people.svg +4 -0
  291. package/src/icons/svg/map-mode.svg +6 -0
  292. package/src/icons/svg/markdown.svg +3 -0
  293. package/src/icons/svg/menu-collapser.svg +2 -0
  294. package/src/icons/svg/message-plus-square.svg +4 -0
  295. package/src/icons/svg/milestones.svg +3 -0
  296. package/src/icons/svg/minus.svg +4 -0
  297. package/src/icons/svg/miro.svg +4 -0
  298. package/src/icons/svg/mirror-off.svg +8 -0
  299. package/src/icons/svg/mirror-on.svg +3 -0
  300. package/src/icons/svg/mixpanel.svg +3 -0
  301. package/src/icons/svg/monitor.svg +3 -0
  302. package/src/icons/svg/more-compact.svg +4 -0
  303. package/src/icons/svg/more.svg +4 -0
  304. package/src/icons/svg/move-bottom.svg +3 -0
  305. package/src/icons/svg/move-left.svg +3 -0
  306. package/src/icons/svg/move-right.svg +3 -0
  307. package/src/icons/svg/move-space.svg +5 -0
  308. package/src/icons/svg/move-top.svg +3 -0
  309. package/src/icons/svg/network-add.svg +5 -0
  310. package/src/icons/svg/network.svg +4 -0
  311. package/src/icons/svg/notifications.svg +2 -0
  312. package/src/icons/svg/obj-child.svg +2 -0
  313. package/src/icons/svg/obj-m2m.svg +2 -0
  314. package/src/icons/svg/obj-o2o.svg +2 -0
  315. package/src/icons/svg/obj-parent.svg +2 -0
  316. package/src/icons/svg/obj-self.svg +2 -0
  317. package/src/icons/svg/on-schedule.svg +3 -0
  318. package/src/icons/svg/open-as-page.svg +4 -0
  319. package/src/icons/svg/page-regular-mode.svg +5 -0
  320. package/src/icons/svg/page-wide-mode.svg +5 -0
  321. package/src/icons/svg/panel-add.svg +3 -0
  322. package/src/icons/svg/pencil.svg +5 -0
  323. package/src/icons/svg/people-check.svg +4 -0
  324. package/src/icons/svg/people.svg +7 -0
  325. package/src/icons/svg/photo.svg +2 -0
  326. package/src/icons/svg/pin-filled.svg +5 -0
  327. package/src/icons/svg/pin.svg +3 -0
  328. package/src/icons/svg/popup.svg +5 -0
  329. package/src/icons/svg/posts.svg +3 -0
  330. package/src/icons/svg/present-play.svg +4 -0
  331. package/src/icons/svg/present-stop.svg +3 -0
  332. package/src/icons/svg/private-items.svg +5 -0
  333. package/src/icons/svg/question.svg +4 -0
  334. package/src/icons/svg/refresh.svg +4 -0
  335. package/src/icons/svg/remove-people.svg +6 -0
  336. package/src/icons/svg/remove.svg +2 -0
  337. package/src/icons/svg/reply.svg +2 -0
  338. package/src/icons/svg/reset-password.svg +6 -0
  339. package/src/icons/svg/restore.svg +2 -0
  340. package/src/icons/svg/richeditor/actions/more.svg +2 -0
  341. package/src/icons/svg/richeditor/block/callout.svg +4 -0
  342. package/src/icons/svg/richeditor/block/code.svg +7 -0
  343. package/src/icons/svg/richeditor/block/embed.svg +4 -0
  344. package/src/icons/svg/richeditor/block/entity.svg +2 -0
  345. package/src/icons/svg/richeditor/block/file.svg +1 -0
  346. package/src/icons/svg/richeditor/block/h1.svg +2 -0
  347. package/src/icons/svg/richeditor/block/h2.svg +2 -0
  348. package/src/icons/svg/richeditor/block/h3.svg +2 -0
  349. package/src/icons/svg/richeditor/block/h4.svg +4 -0
  350. package/src/icons/svg/richeditor/block/mention.svg +2 -0
  351. package/src/icons/svg/richeditor/block/paragraph.svg +2 -0
  352. package/src/icons/svg/richeditor/block/quote.svg +2 -0
  353. package/src/icons/svg/richeditor/checklist/create.svg +2 -0
  354. package/src/icons/svg/richeditor/comment/create.svg +5 -0
  355. package/src/icons/svg/richeditor/entity-link/create.svg +2 -0
  356. package/src/icons/svg/richeditor/history/redo.svg +2 -0
  357. package/src/icons/svg/richeditor/history/undo.svg +2 -0
  358. package/src/icons/svg/richeditor/image/align-center.svg +2 -0
  359. package/src/icons/svg/richeditor/image/align-left.svg +2 -0
  360. package/src/icons/svg/richeditor/image/align-right.svg +2 -0
  361. package/src/icons/svg/richeditor/image/upload.svg +2 -0
  362. package/src/icons/svg/richeditor/image/wrap-center.svg +2 -0
  363. package/src/icons/svg/richeditor/image/wrap-left.svg +2 -0
  364. package/src/icons/svg/richeditor/image/wrap-right.svg +2 -0
  365. package/src/icons/svg/richeditor/image/zoom.svg +5 -0
  366. package/src/icons/svg/richeditor/link/create.svg +9 -0
  367. package/src/icons/svg/richeditor/linkedhighlight/create.svg +2 -0
  368. package/src/icons/svg/richeditor/list/bullet.svg +2 -0
  369. package/src/icons/svg/richeditor/list/indent.svg +2 -0
  370. package/src/icons/svg/richeditor/list/ordered.svg +2 -0
  371. package/src/icons/svg/richeditor/list/unindent.svg +2 -0
  372. package/src/icons/svg/richeditor/mark/code.svg +6 -0
  373. package/src/icons/svg/richeditor/mark/em.svg +2 -0
  374. package/src/icons/svg/richeditor/mark/strike.svg +2 -0
  375. package/src/icons/svg/richeditor/mark/strong.svg +2 -0
  376. package/src/icons/svg/richeditor/mark/text-background-color.svg +2 -0
  377. package/src/icons/svg/richeditor/mark/underline.svg +2 -0
  378. package/src/icons/svg/richeditor/open-link.svg +4 -0
  379. package/src/icons/svg/richeditor/table/create.svg +2 -0
  380. package/src/icons/svg/richeditor/unlink.svg +10 -0
  381. package/src/icons/svg/richeditor/video/upload.svg +2 -0
  382. package/src/icons/svg/right-panel.svg +11 -0
  383. package/src/icons/svg/rows.svg +3 -0
  384. package/src/icons/svg/rule-scheduled.svg +5 -0
  385. package/src/icons/svg/search-add.svg +4 -0
  386. package/src/icons/svg/search-remove.svg +4 -0
  387. package/src/icons/svg/search.svg +2 -0
  388. package/src/icons/svg/self-reference-off.svg +2 -0
  389. package/src/icons/svg/self-reference-on.svg +2 -0
  390. package/src/icons/svg/send-arrow.svg +3 -0
  391. package/src/icons/svg/send-backward.svg +8 -0
  392. package/src/icons/svg/send-to-back.svg +4 -0
  393. package/src/icons/svg/settings-off.svg +4 -0
  394. package/src/icons/svg/settings.svg +4 -0
  395. package/src/icons/svg/share.svg +5 -0
  396. package/src/icons/svg/shared.svg +7 -0
  397. package/src/icons/svg/shield-keyhole.svg +4 -0
  398. package/src/icons/svg/show-author.svg +5 -0
  399. package/src/icons/svg/sidebar-fields-opened.svg +3 -0
  400. package/src/icons/svg/sidebar-fields.svg +6 -0
  401. package/src/icons/svg/sidebar.svg +2 -0
  402. package/src/icons/svg/simple-compass.svg +5 -0
  403. package/src/icons/svg/slack-icon.svg +3 -0
  404. package/src/icons/svg/slack.svg +10 -0
  405. package/src/icons/svg/slide-menu-close.svg +4 -0
  406. package/src/icons/svg/slide-menu-open.svg +4 -0
  407. package/src/icons/svg/slide-menu.svg +5 -0
  408. package/src/icons/svg/smart-folder.svg +5 -0
  409. package/src/icons/svg/sort-on-bottom.svg +4 -0
  410. package/src/icons/svg/sort-on-top.svg +4 -0
  411. package/src/icons/svg/sort.svg +3 -0
  412. package/src/icons/svg/spinner.svg +2 -0
  413. package/src/icons/svg/success.svg +4 -0
  414. package/src/icons/svg/template.svg +3 -0
  415. package/src/icons/svg/templates.svg +4 -0
  416. package/src/icons/svg/terminal.svg +5 -0
  417. package/src/icons/svg/text-tool-align-bottom.svg +3 -0
  418. package/src/icons/svg/text-tool-align-middle.svg +3 -0
  419. package/src/icons/svg/text-tool-align-top.svg +3 -0
  420. package/src/icons/svg/twitter.svg +4 -0
  421. package/src/icons/svg/type/boolean.svg +2 -0
  422. package/src/icons/svg/type/button.svg +4 -0
  423. package/src/icons/svg/type/checkbox.svg +2 -0
  424. package/src/icons/svg/type/date.svg +2 -0
  425. package/src/icons/svg/type/email.svg +2 -0
  426. package/src/icons/svg/type/emoji.svg +2 -0
  427. package/src/icons/svg/type/formula.svg +2 -0
  428. package/src/icons/svg/type/function.svg +2 -0
  429. package/src/icons/svg/type/location.svg +4 -0
  430. package/src/icons/svg/type/lookup.svg +2 -0
  431. package/src/icons/svg/type/money.svg +2 -0
  432. package/src/icons/svg/type/multi-select.svg +2 -0
  433. package/src/icons/svg/type/number.svg +2 -0
  434. package/src/icons/svg/type/percent.svg +2 -0
  435. package/src/icons/svg/type/phone.svg +2 -0
  436. package/src/icons/svg/type/relation.svg +2 -0
  437. package/src/icons/svg/type/rich-text.svg +2 -0
  438. package/src/icons/svg/type/rule.svg +2 -0
  439. package/src/icons/svg/type/single-select.svg +2 -0
  440. package/src/icons/svg/type/text.svg +2 -0
  441. package/src/icons/svg/type/url.svg +9 -0
  442. package/src/icons/svg/units/avatar.svg +5 -0
  443. package/src/icons/svg/units/collection.svg +5 -0
  444. package/src/icons/svg/units/counter.svg +5 -0
  445. package/src/icons/svg/units/date.svg +5 -0
  446. package/src/icons/svg/units/db-badge-abbr.svg +4 -0
  447. package/src/icons/svg/units/db-badge-full.svg +4 -0
  448. package/src/icons/svg/units/db-icon.svg +4 -0
  449. package/src/icons/svg/units/field-icon-button.svg +5 -0
  450. package/src/icons/svg/units/field.svg +4 -0
  451. package/src/icons/svg/units/input.svg +5 -0
  452. package/src/icons/svg/units/progress-bar.svg +5 -0
  453. package/src/icons/svg/units/rich-text.svg +4 -0
  454. package/src/icons/svg/units/snippet.svg +5 -0
  455. package/src/icons/svg/unlink.svg +10 -0
  456. package/src/icons/svg/unlock-filled.svg +5 -0
  457. package/src/icons/svg/unlock-outline.svg +5 -0
  458. package/src/icons/svg/upgrade.svg +2 -0
  459. package/src/icons/svg/usb-flash-drive.svg +5 -0
  460. package/src/icons/svg/user-check.svg +3 -0
  461. package/src/icons/svg/user-group-remove.svg +5 -0
  462. package/src/icons/svg/user-group.svg +4 -0
  463. package/src/icons/svg/user-role.svg +4 -0
  464. package/src/icons/svg/user-x.svg +5 -0
  465. package/src/icons/svg/view-ai.svg +3 -0
  466. package/src/icons/svg/view-board.svg +2 -0
  467. package/src/icons/svg/view-calendar.svg +2 -0
  468. package/src/icons/svg/view-canvas.svg +2 -0
  469. package/src/icons/svg/view-chart.svg +2 -0
  470. package/src/icons/svg/view-details.svg +2 -0
  471. package/src/icons/svg/view-document.svg +2 -0
  472. package/src/icons/svg/view-feed.svg +3 -0
  473. package/src/icons/svg/view-form.svg +4 -0
  474. package/src/icons/svg/view-gantt.svg +5 -0
  475. package/src/icons/svg/view-list.svg +2 -0
  476. package/src/icons/svg/view-map.svg +3 -0
  477. package/src/icons/svg/view-page.svg +3 -0
  478. package/src/icons/svg/view-table.svg +2 -0
  479. package/src/icons/svg/view-timeline.svg +2 -0
  480. package/src/icons/svg/views.svg +11 -0
  481. package/src/icons/svg/warning-triangle.svg +4 -0
  482. package/src/icons/svg/warning.svg +2 -0
  483. package/src/icons/svg/workspace-map.svg +3 -0
  484. package/src/icons/svg/youtube.svg +4 -0
  485. package/src/icons/svg/zoom-in.svg +7 -0
  486. package/src/icons/svg/zoom-out.svg +7 -0
  487. package/src/is-android.ts +3 -0
  488. package/src/is-iOS.ts +8 -0
  489. package/src/is-in-popup.ts +15 -0
  490. package/src/layout.tsx +88 -0
  491. package/src/link-input/components/AntTextAreaWithCustomReadState.js +64 -0
  492. package/src/link-input/index.js +89 -0
  493. package/src/link-input/utils.js +13 -0
  494. package/src/logo.tsx +81 -0
  495. package/src/menu-item-actions.tsx +6 -0
  496. package/src/nested-menu-item.tsx +0 -0
  497. package/src/new-badge.tsx +16 -0
  498. package/src/new-card-placeholder.tsx +231 -0
  499. package/src/not-empty.ts +3 -0
  500. package/src/notification-dot.tsx +23 -0
  501. package/src/number-input/decimal.js +59 -0
  502. package/src/number-input/decimal.test.js +71 -0
  503. package/src/number-input/edit-unit-styles.ts +18 -0
  504. package/src/number-input/index.js +191 -0
  505. package/src/number-input/index.test.js +106 -0
  506. package/src/number-input/number-inline-input-with-autosize.tsx +156 -0
  507. package/src/number-input/number-input.tsx +152 -0
  508. package/src/number-input/stack.tsx +25 -0
  509. package/src/number-input/step-button.tsx +73 -0
  510. package/src/number-input/styles.ts +50 -0
  511. package/src/number-input/text-area-with-autosize.tsx +91 -0
  512. package/src/number-input/text-inline-input-with-autosize.tsx +60 -0
  513. package/src/online-users.tsx +238 -0
  514. package/src/platform.ts +4 -0
  515. package/src/popup/index.tsx +382 -0
  516. package/src/popup/modifiers.tsx +70 -0
  517. package/src/popup/popup-modifiers-context.ts +12 -0
  518. package/src/popup/popup-stack-context.tsx +44 -0
  519. package/src/popup/reference.ts +7 -0
  520. package/src/popup/styles.ts +62 -0
  521. package/src/popup/use-click-outside.ts +22 -0
  522. package/src/progress.tsx +14 -0
  523. package/src/reactions/get-word-divider.tsx +15 -0
  524. package/src/reactions/reaction-button.tsx +254 -0
  525. package/src/reactions/reaction-picker.tsx +126 -0
  526. package/src/reactions/reactions.tsx +30 -0
  527. package/src/ready-to-scroll-context.tsx +16 -0
  528. package/src/rich-input-loader.tsx +78 -0
  529. package/src/rich-text-embed-error.tsx +44 -0
  530. package/src/select/select-in-popover.tsx +3 -0
  531. package/src/styles-utils.tsx +16 -0
  532. package/src/tab-nav/tab-nav.tsx +208 -0
  533. package/src/table.tsx +91 -0
  534. package/src/toast/primitives.tsx +6 -7
  535. package/src/toast/toast-action.tsx +7 -1
  536. package/src/toast/toast-queue.ts +1 -1
  537. package/src/toast/toast.tsx +78 -16
  538. package/src/toast/toaster.tsx +2 -17
  539. package/src/toast/utils/toastify-item-name.ts +16 -5
  540. package/src/tooltip.tsx +3 -0
  541. package/src/type-badge-box.tsx +42 -0
  542. package/src/type-badge.tsx +315 -0
  543. package/src/unit/as-string.tsx +1 -0
  544. package/src/unit/index.tsx +55 -0
  545. package/src/unit/loading-unit-value.tsx +13 -0
  546. package/src/unit/maybe-unit-value.tsx +9 -0
  547. package/src/unit/primitive.tsx +167 -0
  548. package/src/unit/required-indicator.svg +3 -0
  549. package/src/unit/styles.ts +165 -0
  550. package/src/unit/types.ts +31 -0
  551. package/src/unit/unit-button-group.tsx +38 -0
  552. package/src/unit/unit-content-layout.tsx +37 -0
  553. package/src/unit/unit-content.tsx +37 -0
  554. package/src/unit/unit-with-title.tsx +8 -0
  555. package/src/unit/unit-with-tooltip.tsx +60 -0
  556. package/src/use-is-support-hover.ts +5 -0
  557. package/src/use-long-press.tsx +79 -0
  558. package/src/use-me.tsx +11 -0
  559. package/src/use-navigation.tsx +11 -0
  560. package/src/use-why-did-you-update.tsx +78 -0
  561. package/src/utils-dom.ts +26 -0
  562. package/src/with-data.tsx +78 -0
  563. package/src/workflow-progress-icon.tsx +73 -0
  564. package/tsconfig.json +4 -0
  565. package/src/icons/get-icon-container-style.tsx +0 -13
@@ -0,0 +1,254 @@
1
+ import {css, cx} from "@linaria/core";
2
+ import {createPortal} from "react-dom";
3
+ import {useLongPress} from "../use-long-press";
4
+ import {Fragment, ReactNode, useState} from "react";
5
+ import {Emoji} from "../emoji-picker/emoji";
6
+ import {border, lineHeight, space, textStyles, themeVars} from "../design-system";
7
+ import {Tooltip} from "../tooltip";
8
+ import {useIsPhone} from "../use-is-phone";
9
+ import {getWordDivider} from "./get-word-divider";
10
+
11
+ export type Reaction = {
12
+ count: number;
13
+ key: string;
14
+ selected: boolean;
15
+ alias?: string;
16
+ userNames?: Array<string>;
17
+ };
18
+
19
+ type Props = {
20
+ reaction: Reaction;
21
+ disabled?: boolean;
22
+ onSelect: (reactionKey: string) => unknown;
23
+ };
24
+
25
+ export const reactionButtonCss = css`
26
+ all: unset;
27
+ padding-inline: ${space.s6}px;
28
+ box-sizing: border-box;
29
+ display: flex;
30
+ align-items: center;
31
+ min-width: ${space.s24 + space.s12}px;
32
+ justify-content: center;
33
+ height: ${space.s24 + 2}px;
34
+ border: 1.5px solid ${themeVars.colorBgReactionsDefault};
35
+ border-radius: ${border.radius8}px;
36
+ background-color: ${themeVars.colorBgReactionsDefault};
37
+ cursor: pointer;
38
+ line-height: ${lineHeight.nowrap};
39
+ -webkit-user-select: none;
40
+
41
+ &[aria-disabled="true"] {
42
+ cursor: default;
43
+ border-color: ${themeVars.colorBorderReactionsHover};
44
+ background-color: transparent;
45
+ }
46
+
47
+ &:not([aria-disabled="true"]):hover {
48
+ background-color: ${themeVars.colorBgReactionsHover};
49
+ border-color: ${themeVars.colorBorderReactionsHover};
50
+ }
51
+ `;
52
+
53
+ export const selectedReactionButtonCss = css`
54
+ .${reactionButtonCss}& {
55
+ &:not([aria-disabled="true"]) {
56
+ background-color: ${themeVars.colorBgReactionsSelectedDefault};
57
+ border-color: ${themeVars.colorBorderReactionsSelectedDefault};
58
+ }
59
+
60
+ &:not([aria-disabled="true"]):hover {
61
+ background-color: ${themeVars.colorBgReactionsSelectedHover};
62
+ border-color: ${themeVars.colorBorderReactionsSelectedHover};
63
+ }
64
+ }
65
+ `;
66
+
67
+ const countCss = css`
68
+ ${textStyles.small};
69
+ line-height: ${lineHeight.nowrap};
70
+ padding: ${space.s2}px ${space.s2}px ${space.s2}px ${space.s4}px;
71
+ .${selectedReactionButtonCss}:not(:disabled) & {
72
+ color: ${themeVars.colorTextReactionsSelected};
73
+ }
74
+ `;
75
+
76
+ const overlayClassName = css`
77
+ position: absolute;
78
+ z-index: 10001;
79
+ display: flex;
80
+ flex-direction: column;
81
+ inset: 0;
82
+ `;
83
+
84
+ function TouchOverlay({onClick}: {onClick: () => void}) {
85
+ return createPortal(<div className={overlayClassName} onClick={onClick} />, document.body);
86
+ }
87
+
88
+ function MobileOverlay({content, onClose}: {content: ReactNode; onClose: () => void}) {
89
+ return createPortal(
90
+ <div className={overlayClassName}>
91
+ <div
92
+ onClick={onClose}
93
+ className={css`
94
+ background-color: ${themeVars.modalBg};
95
+ flex-grow: 1;
96
+ `}
97
+ />
98
+ <div
99
+ className={css`
100
+ flex-shrink: 0;
101
+ background-color: ${themeVars.tooltipBgColor};
102
+ `}
103
+ >
104
+ {content}
105
+ </div>
106
+ </div>,
107
+ document.body
108
+ );
109
+ }
110
+
111
+ export const ReactionButton = ({reaction, disabled, onSelect}: Props): JSX.Element => {
112
+ const [showOverlay, setShowOverlay] = useState<true | undefined>(undefined);
113
+ const isPhone = useIsPhone();
114
+ const onLongPress = () => {
115
+ // https://github.com/radix-ui/primitives/issues/931 - disable text selection
116
+ if (isPhone) {
117
+ document.body.style.userSelect = "none";
118
+ document.body.style.webkitUserSelect = "none";
119
+ }
120
+ setShowOverlay(true);
121
+ };
122
+ const close = () => {
123
+ setShowOverlay(undefined);
124
+ if (isPhone) {
125
+ document.body.style.userSelect = "";
126
+ document.body.style.webkitUserSelect = "";
127
+ }
128
+ };
129
+
130
+ const longPressEvent = useLongPress(onLongPress, {
131
+ isPreventDefault: true,
132
+ delay: 300,
133
+ });
134
+ const button = (
135
+ <button
136
+ type="button"
137
+ aria-disabled={disabled}
138
+ className={cx(reactionButtonCss, reaction.selected && selectedReactionButtonCss)}
139
+ onClick={() => {
140
+ if (!disabled) {
141
+ onSelect(reaction.key);
142
+ }
143
+ }}
144
+ {...longPressEvent}
145
+ >
146
+ <div
147
+ className={css`
148
+ font-size: 18px;
149
+ height: 18px;
150
+ width: 18px;
151
+ `}
152
+ >
153
+ <Emoji emoji={reaction.key} />
154
+ </div>
155
+ <span className={countCss}>{reaction.count}</span>
156
+ </button>
157
+ );
158
+ if (reaction?.userNames?.length) {
159
+ // noinspection CssInvalidPropertyValue
160
+ const title = (
161
+ <div
162
+ className={css`
163
+ padding-top: ${space.s6}px;
164
+ padding-left: ${space.s6}px;
165
+ padding-right: ${space.s6}px;
166
+ display: flex;
167
+ justify-content: center;
168
+ `}
169
+ >
170
+ <div
171
+ className={css`
172
+ background-color: ${themeVars.whiteColor};
173
+ padding: ${space.s4}px;
174
+ border-radius: ${border.radius4}px;
175
+ `}
176
+ >
177
+ <Emoji emoji={reaction.key} size={64} />
178
+ </div>
179
+ </div>
180
+ );
181
+ const description = (
182
+ <div
183
+ className={cx(
184
+ css`
185
+ padding-top: ${space.s8}px;
186
+ padding-bottom: ${space.s6}px;
187
+ padding-left: ${space.s6}px;
188
+ padding-right: ${space.s6}px;
189
+ text-align: center;
190
+ word-wrap: break-word;
191
+ color: ${themeVars.whiteColor};
192
+ `,
193
+ !isPhone &&
194
+ css`
195
+ max-width: 200px;
196
+ `
197
+ )}
198
+ >
199
+ {reaction.userNames.map((name, index, names) => {
200
+ return (
201
+ <Fragment key={index}>
202
+ <span
203
+ className={css`
204
+ overflow-wrap: break-word;
205
+ `}
206
+ >
207
+ {name}
208
+ </span>
209
+ {getWordDivider(names.length, index)}
210
+ </Fragment>
211
+ );
212
+ })}
213
+ <span
214
+ className={css`
215
+ color: ${themeVars.shortcutTextColor};
216
+ `}
217
+ >
218
+ reacted with {reaction.alias || reaction.key}
219
+ </span>
220
+ </div>
221
+ );
222
+ if (isPhone) {
223
+ return (
224
+ <>
225
+ {button}
226
+ {showOverlay ? (
227
+ <MobileOverlay
228
+ onClose={close}
229
+ content={
230
+ <div
231
+ className={css`
232
+ padding: ${space.s12}px;
233
+ `}
234
+ >
235
+ {title}
236
+ {description}
237
+ </div>
238
+ }
239
+ />
240
+ ) : null}
241
+ </>
242
+ );
243
+ }
244
+ return (
245
+ <>
246
+ <Tooltip visible={showOverlay} title={title} description={description} side="top" sideOffset={space.s8}>
247
+ {button}
248
+ </Tooltip>
249
+ {showOverlay ? <TouchOverlay onClick={close} /> : null}
250
+ </>
251
+ );
252
+ }
253
+ return button;
254
+ };
@@ -0,0 +1,126 @@
1
+ import {EmojiItem} from "@fibery/emoji-data";
2
+ import {measureScrollbar} from "@fibery/helpers/utils/measure-scrollbar";
3
+ import {useControllableState} from "@fibery/react/src/use-controllable-state";
4
+ import {css} from "@linaria/core";
5
+ import {CSSProperties, type FC, useCallback, useState} from "react";
6
+ import {IconButton} from "../button/icon-button";
7
+ import {layout, space, themeVars} from "../design-system";
8
+ import {type EmojiPickerProps} from "../emoji-picker/emoji-picker";
9
+ import AddReactions from "../icons/react/AddReactions";
10
+ import {Popup} from "../popup";
11
+ import {Tooltip} from "../tooltip";
12
+ import {useIsPhone} from "../use-is-phone";
13
+ import {reactionButtonCss} from "./reaction-button";
14
+
15
+ type Props = {
16
+ mode: "default" | "in-row";
17
+ onSelect: (reactionKey: string) => unknown;
18
+ /** The controlled open state of the ReactinoPicker. Must be used in conjunction with onOpenChange. */
19
+ open?: boolean;
20
+ /** Callback called when the open state of the ReactionPicker changes. */
21
+ onOpenChange?: (state: boolean) => unknown;
22
+ EmojiPicker: FC<EmojiPickerProps>;
23
+ };
24
+
25
+ // ant modals have z-index: 1000 and editorPopupZIndex so we have to set it to not be hidden below modals
26
+ const zIndex = 1031;
27
+ const popupContainerCss = css`
28
+ z-index: ${zIndex};
29
+ `;
30
+
31
+ const popupCss = css`
32
+ //background-color: transparent;
33
+ //box-shadow: none;
34
+
35
+ ${{
36
+ maxHeight: `calc(100vh - ${layout.viewHeaderHeight}px - ${space.s24}px)`,
37
+ overflow: "hidden",
38
+ ".ant-tabs-nav": {
39
+ alignItems: "baseline",
40
+ },
41
+ ".ant-tabs-nav::before": {
42
+ borderBottom: `1px solid ${themeVars.separatorColor}`,
43
+ },
44
+ ".ant-tabs-nav-container": {
45
+ marginLeft: 14,
46
+ },
47
+ }}
48
+ `;
49
+
50
+ const pickerOffset: [number, number] = [0, space.s4];
51
+
52
+ export const ReactionPicker = ({mode, onSelect, open, onOpenChange, EmojiPicker}: Props): JSX.Element => {
53
+ const [isOpen = false, setOpen] = useControllableState({value: open, onChange: onOpenChange});
54
+ const [triggerDomElement, setTriggerDomElement] = useState<HTMLButtonElement | null>(null);
55
+ const isPhone = useIsPhone();
56
+ const onEmojiSelect = useCallback(
57
+ (emojiData: EmojiItem) => {
58
+ onSelect(emojiData.colons);
59
+ setOpen(false);
60
+ },
61
+ [onSelect, setOpen]
62
+ );
63
+
64
+ return (
65
+ <div>
66
+ <Tooltip side="bottom" title="Add reaction">
67
+ {mode === "in-row" ? (
68
+ <button
69
+ ref={setTriggerDomElement}
70
+ type="button"
71
+ onClick={() => {
72
+ setOpen(!isOpen);
73
+ }}
74
+ className={reactionButtonCss}
75
+ >
76
+ <AddReactions viewBox={"0 0 20 20"} containerSize={16} iconSize={20} color={themeVars.iconColor} />
77
+ </button>
78
+ ) : (
79
+ <IconButton
80
+ ref={setTriggerDomElement}
81
+ onClick={() => {
82
+ setOpen(!isOpen);
83
+ }}
84
+ size="small"
85
+ >
86
+ <AddReactions />
87
+ </IconButton>
88
+ )}
89
+ </Tooltip>
90
+ {triggerDomElement ? (
91
+ <Popup
92
+ supportMobile
93
+ mobilePopupStyle={
94
+ {
95
+ "--fibery-emoji-container-width": "100%",
96
+ "--fibery-emoji-grid-height": "auto",
97
+ "--fibery-emoji-content-max-height": "auto",
98
+ zIndex: zIndex,
99
+ } as CSSProperties
100
+ }
101
+ title={"Add reaction"}
102
+ placement="auto"
103
+ offset={pickerOffset}
104
+ popupContainerClassName={popupContainerCss}
105
+ popupClassName={popupCss}
106
+ open={isOpen}
107
+ triggerDomElement={triggerDomElement}
108
+ trigger={<></>}
109
+ renderInPortal
110
+ onOpen={() => setOpen(true)}
111
+ onClose={() => setOpen(false)}
112
+ >
113
+ <EmojiPicker
114
+ emojiSize={
115
+ isPhone
116
+ ? Math.min(Math.floor((document.body.clientWidth - 24 - measureScrollbar() - 9 * 12) / 9), 40)
117
+ : 20
118
+ }
119
+ showSkinTones
120
+ onSelect={onEmojiSelect}
121
+ />
122
+ </Popup>
123
+ ) : null}
124
+ </div>
125
+ );
126
+ };
@@ -0,0 +1,30 @@
1
+ import {css} from "@linaria/core";
2
+ import {Reaction, ReactionButton} from "./reaction-button";
3
+ import {ReactionPicker} from "./reaction-picker";
4
+ import {EmojiPickerProps} from "../emoji-picker/emoji-picker";
5
+ import {space} from "../design-system";
6
+ import {type FC} from "react";
7
+
8
+ type Props = {
9
+ reactions: Array<Reaction>;
10
+ onSelect: (reactionKey: string) => void;
11
+ readonly?: boolean;
12
+ EmojiPicker: FC<EmojiPickerProps>;
13
+ };
14
+
15
+ const blockReactionsCss = css`
16
+ display: flex;
17
+ flex-wrap: wrap;
18
+ gap: ${space.s4}px;
19
+ `;
20
+
21
+ export const Reactions: React.FC<Props> = ({reactions, onSelect, readonly, EmojiPicker}) => {
22
+ return (
23
+ <div className={blockReactionsCss}>
24
+ {reactions.map((reaction) => (
25
+ <ReactionButton disabled={readonly} key={reaction.key} reaction={reaction} onSelect={onSelect} />
26
+ ))}
27
+ {!readonly ? <ReactionPicker EmojiPicker={EmojiPicker} mode={"in-row"} onSelect={onSelect} /> : null}
28
+ </div>
29
+ );
30
+ };
@@ -0,0 +1,16 @@
1
+ import {createContext, ReactNode, useContext} from "react";
2
+
3
+ const ReadyToScrollContext = createContext(false);
4
+
5
+ interface ProviderProps {
6
+ value: boolean;
7
+ children?: ReactNode;
8
+ }
9
+
10
+ export function ReadyToScrollContextProvider({children, value}: ProviderProps) {
11
+ return <ReadyToScrollContext.Provider value={value}>{children}</ReadyToScrollContext.Provider>;
12
+ }
13
+
14
+ export function useReadyToScrollContext() {
15
+ return useContext(ReadyToScrollContext);
16
+ }
@@ -0,0 +1,78 @@
1
+ import {memo, createContext, useContext, useState, useEffect, useMemo} from "react";
2
+ import {LoadingSausageList} from "./loading-sausage";
3
+ import {styled} from "@linaria/react";
4
+ import {css, cx} from "@linaria/core";
5
+ import noop from "lodash/noop";
6
+ import {regularRichEditorHTMLStyles} from "./html-styles";
7
+
8
+ const LoaderWrapper = styled.div`
9
+ padding-top: 1px;
10
+ `;
11
+
12
+ const loaderContext = createContext<{showLoader: boolean; setShowLoader: (st: boolean) => void}>({
13
+ showLoader: true,
14
+ setShowLoader: noop,
15
+ });
16
+
17
+ interface LoaderProps {
18
+ className?: string;
19
+ animateAppearance?: boolean;
20
+ }
21
+
22
+ export const RichInputLoader = memo<LoaderProps>(function RichInputLoaderComponent({
23
+ className = "",
24
+ animateAppearance = true,
25
+ }) {
26
+ const {showLoader} = useContext(loaderContext);
27
+ return (
28
+ <div className={className}>
29
+ {showLoader && (
30
+ <LoadingSausageList amount={3} WrapperComponent={LoaderWrapper} animateAppearance={animateAppearance} />
31
+ )}
32
+ </div>
33
+ );
34
+ });
35
+
36
+ export const RichFieldLoaderProvider: React.FC<React.PropsWithChildren> = ({children}) => {
37
+ const [showLoader, setShowLoader] = useState(false);
38
+ useEffect(() => {
39
+ const timeoutId = window.setTimeout(() => setShowLoader(true), 300);
40
+ return () => {
41
+ window.clearTimeout(timeoutId);
42
+ };
43
+ }, []);
44
+ const value = useMemo(() => ({showLoader, setShowLoader}), [showLoader, setShowLoader]);
45
+ return <loaderContext.Provider value={value}>{children}</loaderContext.Provider>;
46
+ };
47
+
48
+ export function RichFieldLoader() {
49
+ const {showLoader} = useContext(loaderContext);
50
+
51
+ return (
52
+ <div
53
+ className={cx(
54
+ "ProseMirror",
55
+ regularRichEditorHTMLStyles,
56
+ css`
57
+ position: relative;
58
+ `
59
+ )}
60
+ >
61
+ <p className="empty-node">
62
+ <br className="ProseMirror-trailingBreak" />
63
+ </p>
64
+ {showLoader ? (
65
+ <div
66
+ className={css`
67
+ position: absolute;
68
+ inset: 0;
69
+ display: grid;
70
+ align-content: center;
71
+ `}
72
+ >
73
+ <LoadingSausageList amount={1} WrapperComponent={LoaderWrapper} />
74
+ </div>
75
+ ) : null}
76
+ </div>
77
+ );
78
+ }
@@ -0,0 +1,44 @@
1
+ import {css, cx} from "@linaria/core";
2
+ import {border, space, themeVars} from "./design-system";
3
+ import ImageXmark from "./icons/react/ImageXmark";
4
+ import {type ReactNode} from "react";
5
+
6
+ const wrapperStyle = css`
7
+ height: 380px;
8
+ display: flex;
9
+ flex-direction: column;
10
+ align-items: center;
11
+ justify-content: center;
12
+ gap: ${space.s6}px;
13
+ background-color: ${themeVars.mentionBgColor};
14
+ border-radius: ${border.radius6}px;
15
+ & ::selection {
16
+ all: unset;
17
+ background: transparent;
18
+ }
19
+ `;
20
+
21
+ const selectedStyle = css`
22
+ box-shadow: 0 0 0 1px ${themeVars.opacity.opacity25}, 0 0 0 3px ${themeVars.focus};
23
+ `;
24
+
25
+ const textStyle = css`
26
+ margin-top: ${space.s6}px;
27
+ max-width: 700px;
28
+ padding: 0 ${space.s24}px;
29
+ color: ${themeVars.disabledTextColor};
30
+ `;
31
+
32
+ type Props = {
33
+ isSelected?: boolean;
34
+ label: ReactNode;
35
+ };
36
+
37
+ export const RichTextEmbedError = ({isSelected, label}: Props) => {
38
+ return (
39
+ <div className={cx(wrapperStyle, isSelected && selectedStyle)}>
40
+ <ImageXmark iconSize={32} color={themeVars.disabledTextColor} />
41
+ <div className={textStyle}>{label}</div>
42
+ </div>
43
+ );
44
+ };
@@ -184,6 +184,7 @@ type Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
184
184
  onSelectKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
185
185
  forbidValuesClearInCollnMode?: boolean;
186
186
  otherSelectProps?: Record<string, unknown>;
187
+ isOptionDisabled?: (option: Option) => boolean;
187
188
  };
188
189
 
189
190
  function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends GroupBase<Option>>(
@@ -222,6 +223,7 @@ function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends Gro
222
223
  onSelectKeyDown,
223
224
  otherSelectProps,
224
225
  forbidValuesClearInCollnMode,
226
+ isOptionDisabled,
225
227
  } = props;
226
228
  const [triggerElement, setTriggerElement] = useState<HTMLDivElement | null>(null);
227
229
  const [visible, setVisible] = useControllableState({
@@ -423,6 +425,7 @@ function SelectInPopoverInner<Option, IsMulti extends boolean, Group extends Gro
423
425
  Menu: mergedComponents.Menu as $TSFixMe,
424
426
  }}
425
427
  forbidValuesClearInCollnMode={forbidValuesClearInCollnMode}
428
+ isOptionDisabled={isOptionDisabled}
426
429
  />
427
430
  </SelectControlSettingsProvider>
428
431
  </Popup>
@@ -0,0 +1,16 @@
1
+ import {css} from "@linaria/core";
2
+ export const visuallyHidden = css`
3
+ clip: rect(0 0 0 0);
4
+ clip-path: inset(50%);
5
+ height: 1px;
6
+ overflow: hidden;
7
+ position: absolute;
8
+ white-space: nowrap;
9
+ width: 1px;
10
+ `;
11
+
12
+ export const ellipsis = css`
13
+ overflow: hidden;
14
+ text-overflow: ellipsis;
15
+ white-space: nowrap;
16
+ `;