@crystallize/design-system 1.4.0 → 1.4.2

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 (380) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/TableComponent-I2YOOYOU.css +281 -0
  3. package/dist/TableComponent-QINOO453.mjs +1377 -0
  4. package/dist/arrow-clockwise-Z2G6UEGP.svg +1 -0
  5. package/dist/arrow-counterclockwise-2O5EYVJT.svg +1 -0
  6. package/dist/bg-color-HB2WDYGO.svg +1 -0
  7. package/dist/camera-CR7D2PNH.svg +1 -0
  8. package/dist/caret-right-fill-FFBNEXVX.svg +1 -0
  9. package/dist/chat-square-quote-CI6PUJHH.svg +1 -0
  10. package/dist/chevron-down-3FRWSIKS.svg +1 -0
  11. package/dist/chunk-VUXQZRSP.mjs +737 -0
  12. package/dist/clipboard-OSEFDF25.svg +1 -0
  13. package/dist/close-FH57ZMJF.svg +1 -0
  14. package/dist/code-SEVR6TIQ.svg +1 -0
  15. package/dist/copy-DMGDODUL.svg +1 -0
  16. package/dist/diagram-2-CEJUD2B4.svg +1 -0
  17. package/dist/download-JXUGIUCX.svg +1 -0
  18. package/dist/draggable-block-menu-KKHDNKJA.svg +1 -0
  19. package/dist/dropdown-more-BHZ5COKX.svg +1 -0
  20. package/dist/file-image-TIQPFJX4.svg +1 -0
  21. package/dist/filetype-gif-OG2BEYYK.svg +1 -0
  22. package/dist/font-color-J4GA3ZJO.svg +1 -0
  23. package/dist/font-family-ZU5N6TTE.svg +1 -0
  24. package/dist/gear-ICMT4NTP.svg +1 -0
  25. package/dist/horizontal-rule-N6RD2V7H.svg +1 -0
  26. package/dist/indent-MJ6JIMCK.svg +1 -0
  27. package/dist/index.css +4209 -0
  28. package/dist/index.d.ts +450 -3
  29. package/dist/index.js +11526 -5
  30. package/dist/index.mjs +9437 -0
  31. package/dist/journal-code-XUT44HDV.svg +1 -0
  32. package/dist/justify-J7X5JEEX.svg +1 -0
  33. package/dist/link-W52N4JKZ.svg +1 -0
  34. package/dist/list-ol-2ZEUN4Z7.svg +1 -0
  35. package/dist/list-ul-DVKNUP47.svg +1 -0
  36. package/dist/lock-WCYOZOHW.svg +1 -0
  37. package/dist/lock-fill-JZSKOSHK.svg +1 -0
  38. package/dist/markdown-4BGQNLLT.svg +1 -0
  39. package/dist/mic-H5FNOMM7.svg +1 -0
  40. package/dist/outdent-2LUMUMIP.svg +1 -0
  41. package/dist/paint-bucket-VCISMZTH.svg +1 -0
  42. package/dist/palette-SWGFPRWZ.svg +1 -0
  43. package/dist/pencil-fill-STFSC26F.svg +1 -0
  44. package/dist/plug-HGGGEVS3.svg +1 -0
  45. package/dist/plug-fill-OTG3U4TN.svg +1 -0
  46. package/dist/plus-CQISIKEC.svg +1 -0
  47. package/dist/plus-slash-minus-N22JU4TI.svg +1 -0
  48. package/dist/prettier-WUJ7B5NV.svg +1 -0
  49. package/dist/prettier-error-DYJSLYDP.svg +1 -0
  50. package/dist/square-check-UTG6FU6D.svg +1 -0
  51. package/dist/success-YVXUMPEZ.svg +1 -0
  52. package/dist/table-BR6DI4ZQ.svg +1 -0
  53. package/dist/text-center-UQI6PAEF.svg +1 -0
  54. package/dist/text-left-KT2B6TR3.svg +1 -0
  55. package/dist/text-paragraph-MFTUIIQG.svg +1 -0
  56. package/dist/text-right-SKELPISG.svg +1 -0
  57. package/dist/trash-UOM6D7TD.svg +1 -0
  58. package/dist/type-bold-PY7COC3N.svg +1 -0
  59. package/dist/type-h1-6KJP7YOM.svg +1 -0
  60. package/dist/type-h2-VHI2USC3.svg +1 -0
  61. package/dist/type-h3-JIU77CHO.svg +1 -0
  62. package/dist/type-h4-P5EHKDAL.svg +1 -0
  63. package/dist/type-h5-CS2KYVRG.svg +1 -0
  64. package/dist/type-h6-J2O74LJZ.svg +1 -0
  65. package/dist/type-italic-3DSFOSG2.svg +1 -0
  66. package/dist/type-strikethrough-E2KKQFSX.svg +1 -0
  67. package/dist/type-subscript-BMPTRIBU.svg +1 -0
  68. package/dist/type-superscript-EDF6EPAA.svg +1 -0
  69. package/dist/type-underline-CBFA5VLF.svg +1 -0
  70. package/dist/upload-Q6KICGZW.svg +1 -0
  71. package/dist/user-EOI2NEFZ.svg +1 -0
  72. package/package.json +114 -79
  73. package/readme.md +9 -0
  74. package/src/action-menu/ActionMenu.stories.tsx +25 -0
  75. package/src/action-menu/action-item.tsx +16 -0
  76. package/src/action-menu/action-menu.css +38 -0
  77. package/src/action-menu/action-menu.tsx +25 -0
  78. package/src/action-menu/index.tsx +3 -0
  79. package/src/avatar/Avatar.stories.tsx +20 -0
  80. package/src/avatar/avatar.css +23 -0
  81. package/src/avatar/avatar.tsx +34 -0
  82. package/src/avatar/get-initials.ts +5 -0
  83. package/src/avatar/index.ts +1 -0
  84. package/src/button/Button.stories.tsx +105 -0
  85. package/src/button/button.css +116 -0
  86. package/src/button/button.tsx +136 -0
  87. package/src/button/index.ts +3 -0
  88. package/src/card/card.css +7 -0
  89. package/src/card/card.stories.tsx +24 -0
  90. package/src/card/card.tsx +27 -0
  91. package/src/card/index.ts +3 -0
  92. package/src/checkbox/checkbox.css +30 -0
  93. package/src/checkbox/checkbox.stories.tsx +62 -0
  94. package/src/checkbox/checkbox.test.tsx +16 -0
  95. package/src/checkbox/checkbox.tsx +28 -0
  96. package/src/checkbox/index.ts +1 -0
  97. package/src/colors/Colors.stories.tsx +127 -0
  98. package/src/colors/color-defaults.json +15 -0
  99. package/src/colors/color-pairing.json +12 -0
  100. package/src/colors/colors.json +158 -0
  101. package/src/colors/index.ts +1 -0
  102. package/src/colors/old-to-new.txt +19 -0
  103. package/src/colors/types.ts +29 -0
  104. package/src/dialog/Dialog.stories.tsx +168 -0
  105. package/src/dialog/Dialog.test.tsx +25 -0
  106. package/src/dialog/config.tsx +139 -0
  107. package/src/dialog/confirm-dialog.tsx +70 -0
  108. package/src/dialog/destroyFns.ts +1 -0
  109. package/src/dialog/dialog.css +27 -0
  110. package/src/dialog/dialog.tsx +95 -0
  111. package/src/dialog/index.tsx +40 -0
  112. package/src/dialog/types.ts +70 -0
  113. package/src/dropdown-menu/DropdownMenu.stories.tsx +38 -0
  114. package/src/dropdown-menu/dropdown-menu-item.tsx +15 -0
  115. package/src/dropdown-menu/dropdown-menu-label.tsx +10 -0
  116. package/src/dropdown-menu/dropdown-menu-root.tsx +33 -0
  117. package/src/dropdown-menu/dropdown-menu.css +20 -0
  118. package/src/dropdown-menu/index.ts +11 -0
  119. package/src/icon-button/IconButton.stories.tsx +45 -0
  120. package/src/icon-button/icon-button.css +50 -0
  121. package/src/icon-button/icon-button.tsx +39 -0
  122. package/src/icon-button/index.ts +3 -0
  123. package/src/iconography/Icon.stories.tsx +47 -0
  124. package/src/iconography/add.tsx +30 -0
  125. package/src/iconography/arrow.tsx +15 -0
  126. package/src/iconography/atom.tsx +59 -0
  127. package/src/iconography/cancel.tsx +26 -0
  128. package/src/iconography/catalogue.tsx +26 -0
  129. package/src/iconography/copy.tsx +24 -0
  130. package/src/iconography/crystal.tsx +93 -0
  131. package/src/iconography/customers.tsx +38 -0
  132. package/src/iconography/edit.tsx +30 -0
  133. package/src/iconography/error.tsx +40 -0
  134. package/src/iconography/fulfilment.tsx +58 -0
  135. package/src/iconography/glasses.tsx +62 -0
  136. package/src/iconography/graphQL.tsx +90 -0
  137. package/src/iconography/grid.tsx +84 -0
  138. package/src/iconography/hooks.tsx +26 -0
  139. package/src/iconography/image.tsx +47 -0
  140. package/src/iconography/index.ts +63 -0
  141. package/src/iconography/info.tsx +41 -0
  142. package/src/iconography/key.tsx +19 -0
  143. package/src/iconography/language.tsx +38 -0
  144. package/src/iconography/nail-polish.tsx +84 -0
  145. package/src/iconography/order.tsx +38 -0
  146. package/src/iconography/particle.tsx +88 -0
  147. package/src/iconography/percentage.tsx +44 -0
  148. package/src/iconography/price-tag.tsx +40 -0
  149. package/src/iconography/shapes.tsx +48 -0
  150. package/src/iconography/subscription.tsx +34 -0
  151. package/src/iconography/topics.tsx +58 -0
  152. package/src/iconography/triangle.tsx +27 -0
  153. package/src/iconography/usage.tsx +34 -0
  154. package/src/iconography/users.tsx +44 -0
  155. package/src/iconography/warning.tsx +51 -0
  156. package/src/index.css +14 -0
  157. package/src/index.ts +33 -0
  158. package/src/inline-radio/index.ts +1 -0
  159. package/src/inline-radio/inline-radio.css +36 -0
  160. package/src/inline-radio/inline-radio.stories.tsx +81 -0
  161. package/src/inline-radio/inline-radio.tsx +41 -0
  162. package/src/input/Input.stories.tsx +26 -0
  163. package/src/input/index.ts +1 -0
  164. package/src/input/input.css +7 -0
  165. package/src/input/input.tsx +20 -0
  166. package/src/input-with-label/InputWithLabel.stories.tsx +98 -0
  167. package/src/input-with-label/index.ts +3 -0
  168. package/src/input-with-label/input-with-label.css +35 -0
  169. package/src/input-with-label/input-with-label.tsx +59 -0
  170. package/src/label/index.ts +1 -0
  171. package/src/label/label.css +3 -0
  172. package/src/label/label.stories.tsx +19 -0
  173. package/src/label/label.tsx +13 -0
  174. package/src/progress/Progress.stories.tsx +26 -0
  175. package/src/progress/index.ts +1 -0
  176. package/src/progress/progress.css +7 -0
  177. package/src/progress/progress.tsx +17 -0
  178. package/src/radio/index.ts +1 -0
  179. package/src/radio/radio.css +20 -0
  180. package/src/radio/radio.stories.tsx +142 -0
  181. package/src/radio/radio.tsx +19 -0
  182. package/src/rich-text-editor/appSettings.ts +28 -0
  183. package/src/rich-text-editor/context/SettingsContext.tsx +71 -0
  184. package/src/rich-text-editor/context/SharedAutocompleteContext.tsx +60 -0
  185. package/src/rich-text-editor/context/SharedHistoryContext.tsx +25 -0
  186. package/src/rich-text-editor/hooks/useReport.ts +64 -0
  187. package/src/rich-text-editor/images/cat-typing.gif +0 -0
  188. package/src/rich-text-editor/images/emoji/1F600.png +0 -0
  189. package/src/rich-text-editor/images/emoji/1F641.png +0 -0
  190. package/src/rich-text-editor/images/emoji/1F642.png +0 -0
  191. package/src/rich-text-editor/images/emoji/2764.png +0 -0
  192. package/src/rich-text-editor/images/emoji/LICENSE.md +5 -0
  193. package/src/rich-text-editor/images/icons/LICENSE.md +5 -0
  194. package/src/rich-text-editor/images/icons/arrow-clockwise.svg +1 -0
  195. package/src/rich-text-editor/images/icons/arrow-counterclockwise.svg +1 -0
  196. package/src/rich-text-editor/images/icons/bg-color.svg +1 -0
  197. package/src/rich-text-editor/images/icons/camera.svg +1 -0
  198. package/src/rich-text-editor/images/icons/card-checklist.svg +1 -0
  199. package/src/rich-text-editor/images/icons/caret-right-fill.svg +1 -0
  200. package/src/rich-text-editor/images/icons/chat-left-text.svg +1 -0
  201. package/src/rich-text-editor/images/icons/chat-right-dots.svg +1 -0
  202. package/src/rich-text-editor/images/icons/chat-right-text.svg +1 -0
  203. package/src/rich-text-editor/images/icons/chat-right.svg +1 -0
  204. package/src/rich-text-editor/images/icons/chat-square-quote.svg +1 -0
  205. package/src/rich-text-editor/images/icons/chevron-down.svg +1 -0
  206. package/src/rich-text-editor/images/icons/clipboard.svg +1 -0
  207. package/src/rich-text-editor/images/icons/close.svg +1 -0
  208. package/src/rich-text-editor/images/icons/code.svg +1 -0
  209. package/src/rich-text-editor/images/icons/comments.svg +1 -0
  210. package/src/rich-text-editor/images/icons/copy.svg +1 -0
  211. package/src/rich-text-editor/images/icons/diagram-2.svg +1 -0
  212. package/src/rich-text-editor/images/icons/download.svg +1 -0
  213. package/src/rich-text-editor/images/icons/draggable-block-menu.svg +1 -0
  214. package/src/rich-text-editor/images/icons/dropdown-more.svg +1 -0
  215. package/src/rich-text-editor/images/icons/figma.svg +1 -0
  216. package/src/rich-text-editor/images/icons/file-image.svg +1 -0
  217. package/src/rich-text-editor/images/icons/filetype-gif.svg +1 -0
  218. package/src/rich-text-editor/images/icons/font-color.svg +1 -0
  219. package/src/rich-text-editor/images/icons/font-family.svg +1 -0
  220. package/src/rich-text-editor/images/icons/gear.svg +1 -0
  221. package/src/rich-text-editor/images/icons/horizontal-rule.svg +1 -0
  222. package/src/rich-text-editor/images/icons/indent.svg +1 -0
  223. package/src/rich-text-editor/images/icons/journal-code.svg +1 -0
  224. package/src/rich-text-editor/images/icons/journal-text.svg +1 -0
  225. package/src/rich-text-editor/images/icons/justify.svg +1 -0
  226. package/src/rich-text-editor/images/icons/link.svg +1 -0
  227. package/src/rich-text-editor/images/icons/list-ol.svg +1 -0
  228. package/src/rich-text-editor/images/icons/list-ul.svg +1 -0
  229. package/src/rich-text-editor/images/icons/lock-fill.svg +1 -0
  230. package/src/rich-text-editor/images/icons/lock.svg +1 -0
  231. package/src/rich-text-editor/images/icons/markdown.svg +1 -0
  232. package/src/rich-text-editor/images/icons/mic.svg +1 -0
  233. package/src/rich-text-editor/images/icons/outdent.svg +1 -0
  234. package/src/rich-text-editor/images/icons/paint-bucket.svg +1 -0
  235. package/src/rich-text-editor/images/icons/palette.svg +1 -0
  236. package/src/rich-text-editor/images/icons/pencil-fill.svg +1 -0
  237. package/src/rich-text-editor/images/icons/plug-fill.svg +1 -0
  238. package/src/rich-text-editor/images/icons/plug.svg +1 -0
  239. package/src/rich-text-editor/images/icons/plus-slash-minus.svg +1 -0
  240. package/src/rich-text-editor/images/icons/plus.svg +1 -0
  241. package/src/rich-text-editor/images/icons/prettier-error.svg +1 -0
  242. package/src/rich-text-editor/images/icons/prettier.svg +1 -0
  243. package/src/rich-text-editor/images/icons/send.svg +1 -0
  244. package/src/rich-text-editor/images/icons/square-check.svg +1 -0
  245. package/src/rich-text-editor/images/icons/sticky.svg +1 -0
  246. package/src/rich-text-editor/images/icons/success.svg +1 -0
  247. package/src/rich-text-editor/images/icons/table.svg +1 -0
  248. package/src/rich-text-editor/images/icons/text-center.svg +1 -0
  249. package/src/rich-text-editor/images/icons/text-left.svg +1 -0
  250. package/src/rich-text-editor/images/icons/text-paragraph.svg +1 -0
  251. package/src/rich-text-editor/images/icons/text-right.svg +1 -0
  252. package/src/rich-text-editor/images/icons/trash.svg +1 -0
  253. package/src/rich-text-editor/images/icons/trash3.svg +1 -0
  254. package/src/rich-text-editor/images/icons/tweet.svg +1 -0
  255. package/src/rich-text-editor/images/icons/type-bold.svg +1 -0
  256. package/src/rich-text-editor/images/icons/type-h1.svg +1 -0
  257. package/src/rich-text-editor/images/icons/type-h2.svg +1 -0
  258. package/src/rich-text-editor/images/icons/type-h3.svg +1 -0
  259. package/src/rich-text-editor/images/icons/type-h4.svg +1 -0
  260. package/src/rich-text-editor/images/icons/type-h5.svg +1 -0
  261. package/src/rich-text-editor/images/icons/type-h6.svg +1 -0
  262. package/src/rich-text-editor/images/icons/type-italic.svg +1 -0
  263. package/src/rich-text-editor/images/icons/type-strikethrough.svg +1 -0
  264. package/src/rich-text-editor/images/icons/type-subscript.svg +1 -0
  265. package/src/rich-text-editor/images/icons/type-superscript.svg +1 -0
  266. package/src/rich-text-editor/images/icons/type-underline.svg +1 -0
  267. package/src/rich-text-editor/images/icons/upload.svg +1 -0
  268. package/src/rich-text-editor/images/icons/user.svg +1 -0
  269. package/src/rich-text-editor/images/icons/youtube.svg +1 -0
  270. package/src/rich-text-editor/images/image/LICENSE.md +5 -0
  271. package/src/rich-text-editor/images/landscape.jpg +0 -0
  272. package/src/rich-text-editor/images/logo.svg +1 -0
  273. package/src/rich-text-editor/images/yellow-flower-small.jpg +0 -0
  274. package/src/rich-text-editor/images/yellow-flower.jpg +0 -0
  275. package/src/rich-text-editor/index.ts +1 -0
  276. package/src/rich-text-editor/model/crystallize-rich-text-types/code.ts +39 -0
  277. package/src/rich-text-editor/model/crystallize-rich-text-types/headings.ts +12 -0
  278. package/src/rich-text-editor/model/crystallize-rich-text-types/index.ts +69 -0
  279. package/src/rich-text-editor/model/crystallize-rich-text-types/link.ts +9 -0
  280. package/src/rich-text-editor/model/crystallize-rich-text-types/table.ts +16 -0
  281. package/src/rich-text-editor/model/crystallize-to-lexical.ts +186 -0
  282. package/src/rich-text-editor/model/lexical-to-crystallize.ts +232 -0
  283. package/src/rich-text-editor/nodes/AutocompleteNode.tsx +96 -0
  284. package/src/rich-text-editor/nodes/BaseNodes.ts +45 -0
  285. package/src/rich-text-editor/nodes/KeywordNode.ts +73 -0
  286. package/src/rich-text-editor/nodes/TableCellNodes.ts +31 -0
  287. package/src/rich-text-editor/nodes/TableComponent.tsx +1547 -0
  288. package/src/rich-text-editor/nodes/TableNode.tsx +398 -0
  289. package/src/rich-text-editor/plugins/ActionsPlugin/index.tsx +83 -0
  290. package/src/rich-text-editor/plugins/AutoLinkPlugin/index.tsx +47 -0
  291. package/src/rich-text-editor/plugins/AutocompletePlugin/index.tsx +2536 -0
  292. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx +60 -0
  293. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.css +14 -0
  294. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx +140 -0
  295. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/index.css +46 -0
  296. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx +155 -0
  297. package/src/rich-text-editor/plugins/CodeHighlightPlugin/index.ts +21 -0
  298. package/src/rich-text-editor/plugins/ComponentPickerPlugin/index.tsx +320 -0
  299. package/src/rich-text-editor/plugins/DragDropPastePlugin/index.ts +40 -0
  300. package/src/rich-text-editor/plugins/DraggableBlockPlugin/index.css +36 -0
  301. package/src/rich-text-editor/plugins/DraggableBlockPlugin/index.tsx +368 -0
  302. package/src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.css +40 -0
  303. package/src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.tsx +305 -0
  304. package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.css +128 -0
  305. package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +351 -0
  306. package/src/rich-text-editor/plugins/LinkPlugin/index.tsx +16 -0
  307. package/src/rich-text-editor/plugins/ListMaxIndentLevelPlugin/index.ts +86 -0
  308. package/src/rich-text-editor/plugins/MarkdownShortcutPlugin/index.tsx +16 -0
  309. package/src/rich-text-editor/plugins/MarkdownTransformers/index.ts +195 -0
  310. package/src/rich-text-editor/plugins/MaxLengthPlugin/index.tsx +49 -0
  311. package/src/rich-text-editor/plugins/SpeechToTextPlugin/index.ts +113 -0
  312. package/src/rich-text-editor/plugins/TabFocusPlugin/index.tsx +65 -0
  313. package/src/rich-text-editor/plugins/TableActionMenuPlugin/index.tsx +481 -0
  314. package/src/rich-text-editor/plugins/TableCellResizer/index.css +12 -0
  315. package/src/rich-text-editor/plugins/TableCellResizer/index.tsx +386 -0
  316. package/src/rich-text-editor/plugins/TablePlugin.tsx +190 -0
  317. package/src/rich-text-editor/plugins/ToolbarPlugin/index.tsx +726 -0
  318. package/src/rich-text-editor/plugins/TreeViewPlugin/index.tsx +25 -0
  319. package/src/rich-text-editor/plugins/TypingPerfPlugin/index.ts +117 -0
  320. package/src/rich-text-editor/rich-text-editor.css +1361 -0
  321. package/src/rich-text-editor/rich-text-editor.stories.tsx +385 -0
  322. package/src/rich-text-editor/rich-text-editor.tsx +228 -0
  323. package/src/rich-text-editor/tests/rich-text-editor-basic-rendering.test.tsx +47 -0
  324. package/src/rich-text-editor/tests/rich-text-editor-code.test.tsx +39 -0
  325. package/src/rich-text-editor/tests/rich-text-editor-model-basics.test.tsx +56 -0
  326. package/src/rich-text-editor/tests/rich-text-editor-model-conversions.test.tsx +195 -0
  327. package/src/rich-text-editor/tests/rich-text-editor-onchange.test.tsx +37 -0
  328. package/src/rich-text-editor/tests/rich-text-editor-quote.test.tsx +36 -0
  329. package/src/rich-text-editor/tests/rich-text-editor-text-formats.test.tsx +135 -0
  330. package/src/rich-text-editor/tests/rich-text-editor-typing.test.tsx +73 -0
  331. package/src/rich-text-editor/tests/utils.ts +23 -0
  332. package/src/rich-text-editor/themes/PlaygroundEditorTheme.css +433 -0
  333. package/src/rich-text-editor/themes/PlaygroundEditorTheme.ts +113 -0
  334. package/src/rich-text-editor/types.ts +5 -0
  335. package/src/rich-text-editor/ui/ContentEditable.css +13 -0
  336. package/src/rich-text-editor/ui/ContentEditable.tsx +15 -0
  337. package/src/rich-text-editor/ui/LinkPreview.css +57 -0
  338. package/src/rich-text-editor/ui/LinkPreview.tsx +169 -0
  339. package/src/rich-text-editor/utils/environment.ts +1 -0
  340. package/src/rich-text-editor/utils/getDOMRangeRect.ts +42 -0
  341. package/src/rich-text-editor/utils/getSelectedNode.ts +27 -0
  342. package/src/rich-text-editor/utils/guard.ts +10 -0
  343. package/src/rich-text-editor/utils/isMobileWidth.ts +7 -0
  344. package/src/rich-text-editor/utils/joinClasses.ts +13 -0
  345. package/src/rich-text-editor/utils/point.ts +55 -0
  346. package/src/rich-text-editor/utils/rect.ts +158 -0
  347. package/src/rich-text-editor/utils/setFloatingElemPosition.ts +46 -0
  348. package/src/rich-text-editor/utils/swipe.ts +127 -0
  349. package/src/rich-text-editor/utils/url.ts +33 -0
  350. package/src/select/index.ts +1 -0
  351. package/src/select/select-item.tsx +18 -0
  352. package/src/select/select-root.tsx +50 -0
  353. package/src/select/select.css +44 -0
  354. package/src/select/select.stories.tsx +74 -0
  355. package/src/select/select.ts +9 -0
  356. package/src/slider/Slider.stories.tsx +54 -0
  357. package/src/slider/index.ts +1 -0
  358. package/src/slider/slider.css +27 -0
  359. package/src/slider/slider.tsx +20 -0
  360. package/src/spinner/Spinner.stories.tsx +19 -0
  361. package/src/spinner/index.tsx +48 -0
  362. package/src/spinner/spinner.css +11 -0
  363. package/src/tag/Tag.stories.tsx +32 -0
  364. package/src/tag/index.ts +1 -0
  365. package/src/tag/tag.css +7 -0
  366. package/src/tag/tag.tsx +27 -0
  367. package/src/vite-env.d.ts +1 -0
  368. package/tailwind.config.cjs +51 -0
  369. package/LICENSE +0 -21
  370. package/README.md +0 -87
  371. package/dist/components/Button.d.ts +0 -11
  372. package/dist/components/Checkbox.d.ts +0 -29
  373. package/dist/components/Typography.d.ts +0 -14
  374. package/dist/design-system.cjs.development.js +0 -251
  375. package/dist/design-system.cjs.development.js.map +0 -1
  376. package/dist/design-system.cjs.production.min.js +0 -2
  377. package/dist/design-system.cjs.production.min.js.map +0 -1
  378. package/dist/design-system.esm.js +0 -245
  379. package/dist/design-system.esm.js.map +0 -1
  380. package/dist/styles/theme.d.ts +0 -2
@@ -0,0 +1,1361 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ .c-rich-text-editor {
10
+ margin: 0px auto;
11
+ max-width: 1100px;
12
+ position: relative;
13
+ line-height: 1.7;
14
+ > * {
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ @apply !font-sans font-normal text-gray-900-50;
19
+
20
+ .editor-container {
21
+ background: #fff;
22
+ position: relative;
23
+ cursor: text;
24
+ @apply mt-2 rounded-bl-md rounded-br-md;
25
+ }
26
+
27
+ .editor-container.plain-text {
28
+ @apply rounded-tl-md rounded-tr-md;
29
+ }
30
+
31
+ span.editor-image {
32
+ cursor: default;
33
+ display: inline-block;
34
+ position: relative;
35
+ user-select: none;
36
+ }
37
+
38
+ .editor-image img {
39
+ max-width: 100%;
40
+ cursor: default;
41
+ }
42
+
43
+ .editor-image img.focused {
44
+ outline: 2px solid rgb(60, 132, 244);
45
+ user-select: none;
46
+ }
47
+
48
+ .editor-image img.focused.draggable {
49
+ cursor: grab;
50
+ }
51
+
52
+ .editor-image img.focused.draggable:active {
53
+ cursor: grabbing;
54
+ }
55
+
56
+ .editor-image .image-caption-container {
57
+ display: block;
58
+ position: absolute;
59
+ bottom: 4px;
60
+ left: 0;
61
+ right: 0;
62
+ padding: 0;
63
+ margin: 0;
64
+ border-top: 1px solid #fff;
65
+ background-color: rgba(255, 255, 255, 0.9);
66
+ min-width: 100px;
67
+ color: #000;
68
+ overflow: hidden;
69
+ }
70
+
71
+ .editor-image .image-caption-button {
72
+ display: block;
73
+ position: absolute;
74
+ bottom: 20px;
75
+ left: 0;
76
+ right: 0;
77
+ width: 30%;
78
+ padding: 10px;
79
+ margin: 0 auto;
80
+ border: 1px solid rgba(255, 255, 255, 0.3);
81
+ border-radius: 5px;
82
+ background-color: rgba(0, 0, 0, 0.5);
83
+ min-width: 100px;
84
+ color: #fff;
85
+ cursor: pointer;
86
+ user-select: none;
87
+ }
88
+
89
+ .editor-image .image-caption-button:hover {
90
+ background-color: rgba(60, 132, 244, 0.5);
91
+ }
92
+
93
+ .editor-image .image-resizer {
94
+ display: block;
95
+ width: 7px;
96
+ height: 7px;
97
+ position: absolute;
98
+ background-color: rgb(60, 132, 244);
99
+ border: 1px solid #fff;
100
+ }
101
+
102
+ .editor-image .image-resizer.image-resizer-n {
103
+ top: -6px;
104
+ left: 48%;
105
+ cursor: n-resize;
106
+ }
107
+
108
+ .editor-image .image-resizer.image-resizer-ne {
109
+ top: -6px;
110
+ right: -6px;
111
+ cursor: ne-resize;
112
+ }
113
+
114
+ .editor-image .image-resizer.image-resizer-e {
115
+ bottom: 48%;
116
+ right: -6px;
117
+ cursor: e-resize;
118
+ }
119
+
120
+ .editor-image .image-resizer.image-resizer-se {
121
+ bottom: -2px;
122
+ right: -6px;
123
+ cursor: nwse-resize;
124
+ }
125
+
126
+ .editor-image .image-resizer.image-resizer-s {
127
+ bottom: -2px;
128
+ left: 48%;
129
+ cursor: s-resize;
130
+ }
131
+
132
+ .editor-image .image-resizer.image-resizer-sw {
133
+ bottom: -2px;
134
+ left: -6px;
135
+ cursor: sw-resize;
136
+ }
137
+
138
+ .editor-image .image-resizer.image-resizer-w {
139
+ bottom: 48%;
140
+ left: -6px;
141
+ cursor: w-resize;
142
+ }
143
+
144
+ .editor-image .image-resizer.image-resizer-nw {
145
+ top: -6px;
146
+ left: -6px;
147
+ cursor: nw-resize;
148
+ }
149
+
150
+ .editor-scroller {
151
+ min-height: 150px;
152
+ border: 0;
153
+ resize: none;
154
+ cursor: text;
155
+ display: block;
156
+ position: relative;
157
+ outline: 0;
158
+ resize: vertical;
159
+ }
160
+
161
+ .editor {
162
+ height: 100%;
163
+ position: relative;
164
+ }
165
+
166
+ .test-recorder-output {
167
+ margin: 20px auto 20px auto;
168
+ width: 100%;
169
+ }
170
+
171
+ pre {
172
+ line-height: 1.1;
173
+ color: #fff;
174
+ margin: 0;
175
+ padding: 10px;
176
+ overflow: auto;
177
+ max-height: 180px;
178
+ @apply bg-purple-50-900 text-sm;
179
+ }
180
+
181
+ pre::-webkit-scrollbar {
182
+ background: transparent;
183
+ width: 10px;
184
+ }
185
+
186
+ pre::-webkit-scrollbar-thumb {
187
+ background: #999;
188
+ }
189
+
190
+ .editor-dev-button {
191
+ position: relative;
192
+ display: block;
193
+ width: 40px;
194
+ height: 40px;
195
+ font-size: 12px;
196
+ border-radius: 20px;
197
+ border: none;
198
+ cursor: pointer;
199
+ outline: none;
200
+ box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.3);
201
+ background-color: #444;
202
+ }
203
+
204
+ .editor-dev-button::after {
205
+ content: '';
206
+ position: absolute;
207
+ top: 10px;
208
+ right: 10px;
209
+ bottom: 10px;
210
+ left: 10px;
211
+ display: block;
212
+ background-size: contain;
213
+ filter: invert(1);
214
+ }
215
+
216
+ .editor-dev-button:hover {
217
+ background-color: #555;
218
+ }
219
+
220
+ .editor-dev-button.active {
221
+ background-color: rgb(233, 35, 35);
222
+ }
223
+
224
+ .test-recorder-toolbar {
225
+ display: flex;
226
+ }
227
+
228
+ .test-recorder-button {
229
+ position: relative;
230
+ display: block;
231
+ width: 32px;
232
+ height: 32px;
233
+ font-size: 10px;
234
+ padding: 6px 6px;
235
+ border-radius: 4px;
236
+ border: none;
237
+ cursor: pointer;
238
+ outline: none;
239
+ box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.4);
240
+ background-color: #222;
241
+ transition: box-shadow 50ms ease-out;
242
+ }
243
+
244
+ .test-recorder-button:active {
245
+ box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
246
+ }
247
+
248
+ .test-recorder-button + .test-recorder-button {
249
+ margin-left: 4px;
250
+ }
251
+
252
+ .test-recorder-button::after {
253
+ content: '';
254
+ position: absolute;
255
+ top: 8px;
256
+ right: 8px;
257
+ bottom: 8px;
258
+ left: 8px;
259
+ display: block;
260
+ background-size: contain;
261
+ filter: invert(1);
262
+ }
263
+
264
+ #options-button {
265
+ position: fixed;
266
+ left: 20px;
267
+ bottom: 20px;
268
+ }
269
+
270
+ #test-recorder-button {
271
+ position: fixed;
272
+ left: 70px;
273
+ bottom: 20px;
274
+ }
275
+
276
+ #paste-log-button {
277
+ position: fixed;
278
+ left: 120px;
279
+ bottom: 20px;
280
+ }
281
+
282
+ #options-button::after {
283
+ background-image: url(images/icons/gear.svg);
284
+ }
285
+
286
+ #test-recorder-button::after {
287
+ background-image: url(images/icons/journal-code.svg);
288
+ }
289
+
290
+ #paste-log-button::after {
291
+ background-image: url(images/icons/clipboard.svg);
292
+ }
293
+
294
+ #test-recorder-button-snapshot {
295
+ margin-right: auto;
296
+ }
297
+
298
+ #test-recorder-button-snapshot::after {
299
+ background-image: url(images/icons/camera.svg);
300
+ }
301
+
302
+ #test-recorder-button-copy::after {
303
+ background-image: url(images/icons/clipboard.svg);
304
+ }
305
+
306
+ #test-recorder-button-download::after {
307
+ background-image: url(images/icons/download.svg);
308
+ }
309
+
310
+ .typeahead-popover {
311
+ background: #fff;
312
+ box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
313
+ border-radius: 8px;
314
+ margin-top: 25px;
315
+ }
316
+
317
+ .typeahead-popover ul {
318
+ padding: 0;
319
+ list-style: none;
320
+ margin: 0;
321
+ border-radius: 8px;
322
+ max-height: 200px;
323
+ overflow-y: scroll;
324
+ }
325
+
326
+ .typeahead-popover ul::-webkit-scrollbar {
327
+ display: none;
328
+ }
329
+
330
+ .typeahead-popover ul {
331
+ -ms-overflow-style: none;
332
+ scrollbar-width: none;
333
+ }
334
+
335
+ .typeahead-popover ul li {
336
+ margin: 0;
337
+ min-width: 180px;
338
+ font-size: 14px;
339
+ outline: none;
340
+ cursor: pointer;
341
+ border-radius: 8px;
342
+ }
343
+
344
+ .typeahead-popover ul li.selected {
345
+ background: #eee;
346
+ }
347
+
348
+ .typeahead-popover li {
349
+ margin: 0 8px 0 8px;
350
+ padding: 8px;
351
+ color: #050505;
352
+ cursor: pointer;
353
+ line-height: 16px;
354
+ font-size: 15px;
355
+ display: flex;
356
+ align-content: center;
357
+ flex-direction: row;
358
+ flex-shrink: 0;
359
+ background-color: #fff;
360
+ border-radius: 8px;
361
+ border: 0;
362
+ }
363
+
364
+ .typeahead-popover li.active {
365
+ display: flex;
366
+ width: 20px;
367
+ height: 20px;
368
+ background-size: contain;
369
+ }
370
+
371
+ .typeahead-popover li:first-child {
372
+ border-radius: 8px 8px 0px 0px;
373
+ }
374
+
375
+ .typeahead-popover li:last-child {
376
+ border-radius: 0px 0px 8px 8px;
377
+ }
378
+
379
+ .typeahead-popover li:hover {
380
+ background-color: #eee;
381
+ }
382
+
383
+ .typeahead-popover li .text {
384
+ display: flex;
385
+ line-height: 20px;
386
+ flex-grow: 1;
387
+ min-width: 150px;
388
+ }
389
+
390
+ .typeahead-popover li .icon {
391
+ display: flex;
392
+ width: 20px;
393
+ height: 20px;
394
+ user-select: none;
395
+ margin-right: 8px;
396
+ line-height: 16px;
397
+ background-size: contain;
398
+ background-repeat: no-repeat;
399
+ background-position: center;
400
+ }
401
+
402
+ .component-picker-menu {
403
+ width: 200px;
404
+ }
405
+
406
+ .auto-embed-menu {
407
+ width: 150px;
408
+ }
409
+
410
+ i.palette {
411
+ background-image: url(images/icons/palette.svg);
412
+ }
413
+
414
+ i.bucket {
415
+ background-image: url(images/icons/paint-bucket.svg);
416
+ }
417
+
418
+ i.bold {
419
+ background-image: url(images/icons/type-bold.svg);
420
+ }
421
+
422
+ i.italic {
423
+ background-image: url(images/icons/type-italic.svg);
424
+ }
425
+
426
+ i.clear {
427
+ background-image: url(images/icons/trash.svg);
428
+ }
429
+
430
+ i.code {
431
+ background-image: url(images/icons/code.svg);
432
+ }
433
+
434
+ i.underline {
435
+ background-image: url(images/icons/type-underline.svg);
436
+ }
437
+
438
+ i.strikethrough {
439
+ background-image: url(images/icons/type-strikethrough.svg);
440
+ }
441
+
442
+ i.subscript {
443
+ background-image: url(images/icons/type-subscript.svg);
444
+ }
445
+
446
+ i.superscript {
447
+ background-image: url(images/icons/type-superscript.svg);
448
+ }
449
+
450
+ i.link {
451
+ background-image: url(images/icons/link.svg);
452
+ }
453
+
454
+ i.horizontal-rule {
455
+ background-image: url(images/icons/horizontal-rule.svg);
456
+ }
457
+
458
+ .icon.plus {
459
+ background-image: url(images/icons/plus.svg);
460
+ }
461
+
462
+ .icon.caret-right {
463
+ background-image: url(images/icons/caret-right-fill.svg);
464
+ }
465
+
466
+ .icon.dropdown-more {
467
+ background-image: url(images/icons/dropdown-more.svg);
468
+ }
469
+
470
+ .icon.font-color {
471
+ background-image: url(images/icons/font-color.svg);
472
+ }
473
+
474
+ .icon.font-family {
475
+ background-image: url(images/icons/font-family.svg);
476
+ }
477
+
478
+ .icon.bg-color {
479
+ background-image: url(images/icons/bg-color.svg);
480
+ }
481
+
482
+ i.image {
483
+ background-image: url(images/icons/file-image.svg);
484
+ }
485
+
486
+ i.table {
487
+ background-image: url(images/icons/table.svg);
488
+ }
489
+
490
+ i.close {
491
+ background-image: url(images/icons/close.svg);
492
+ }
493
+
494
+ .icon.left-align,
495
+ i.left-align {
496
+ background-image: url(images/icons/text-left.svg);
497
+ }
498
+
499
+ i.center-align {
500
+ background-image: url(images/icons/text-center.svg);
501
+ }
502
+
503
+ i.right-align {
504
+ background-image: url(images/icons/text-right.svg);
505
+ }
506
+
507
+ i.justify-align {
508
+ background-image: url(images/icons/justify.svg);
509
+ }
510
+
511
+ i.indent {
512
+ background-image: url(images/icons/indent.svg);
513
+ }
514
+
515
+ i.markdown {
516
+ background-image: url(images/icons/markdown.svg);
517
+ }
518
+
519
+ i.outdent {
520
+ background-image: url(images/icons/outdent.svg);
521
+ }
522
+
523
+ i.undo {
524
+ background-image: url(images/icons/arrow-counterclockwise.svg);
525
+ }
526
+
527
+ i.redo {
528
+ background-image: url(images/icons/arrow-clockwise.svg);
529
+ }
530
+
531
+ i.mic {
532
+ background-image: url(images/icons/mic.svg);
533
+ }
534
+
535
+ i.import {
536
+ background-image: url(images/icons/upload.svg);
537
+ }
538
+
539
+ i.export {
540
+ background-image: url(images/icons/download.svg);
541
+ }
542
+
543
+ i.diagram-2 {
544
+ background-image: url(images/icons/diagram-2.svg);
545
+ }
546
+
547
+ i.user {
548
+ background-image: url(images/icons/user.svg);
549
+ }
550
+
551
+ i.equation {
552
+ background-image: url(images/icons/plus-slash-minus.svg);
553
+ }
554
+
555
+ i.gif {
556
+ background-image: url(images/icons/filetype-gif.svg);
557
+ }
558
+
559
+ i.copy {
560
+ background-image: url(images/icons/copy.svg);
561
+ }
562
+
563
+ i.success {
564
+ background-image: url(images/icons/success.svg);
565
+ }
566
+
567
+ i.prettier {
568
+ background-image: url(images/icons/prettier.svg);
569
+ }
570
+
571
+ i.prettier-error {
572
+ background-image: url(images/icons/prettier-error.svg);
573
+ }
574
+
575
+ .link-editor {
576
+ box-sizing: border-box;
577
+ }
578
+ .link-editor .button.active,
579
+ .toolbar .button.active {
580
+ @apply bg-purple-50-900;
581
+ }
582
+ .link-editor {
583
+ @apply !rounded-lg border border-solid border-gray-100-800 !shadow-lg;
584
+ }
585
+ .link-editor .link-input {
586
+ width: 100%;
587
+ box-sizing: border-box;
588
+ margin: 8px 0;
589
+ padding: 8px 24px;
590
+ /* background-color: #eee; */
591
+ font-size: 15px;
592
+ color: rgb(5, 5, 5);
593
+ outline: 0;
594
+ position: relative;
595
+ font-family: inherit;
596
+
597
+ @apply border-gray text-sm text-s-blue-600-300;
598
+ }
599
+
600
+ .link-editor div.link-edit {
601
+ background-image: url(images/icons/pencil-fill.svg);
602
+ background-size: 12px;
603
+ background-position: center;
604
+ background-repeat: no-repeat;
605
+ width: 35px;
606
+ vertical-align: -0.25em;
607
+ position: absolute;
608
+ right: 0;
609
+ top: 0;
610
+ bottom: 0;
611
+ cursor: pointer;
612
+ }
613
+ .link-editor .link-input {
614
+ box-sizing: border-box;
615
+ }
616
+ .link-editor .link-input a {
617
+ color: rgb(33, 111, 219);
618
+ text-decoration: none;
619
+ display: block;
620
+ white-space: nowrap;
621
+ overflow: hidden;
622
+ text-overflow: ellipsis;
623
+ @apply text-s-blue-600-300;
624
+ }
625
+
626
+ .link-editor .link-input a:hover {
627
+ text-decoration: underline;
628
+ }
629
+
630
+ .link-editor .font-size-wrapper,
631
+ .link-editor .font-family-wrapper {
632
+ display: flex;
633
+ margin: 0 4px;
634
+ }
635
+
636
+ .link-editor select {
637
+ padding: 6px;
638
+ border: none;
639
+ background-color: rgba(0, 0, 0, 0.075);
640
+ border-radius: 4px;
641
+ }
642
+
643
+ #block-controls {
644
+ display: block;
645
+ position: absolute;
646
+ right: 10px;
647
+ width: 32px;
648
+ height: 32px;
649
+ box-sizing: border-box;
650
+ box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
651
+ top: 16px;
652
+ z-index: 10;
653
+ border-radius: 8px;
654
+ border: 1px solid rgb(206, 208, 212);
655
+ overflow: hidden;
656
+ }
657
+
658
+ #block-controls button {
659
+ border: 1px solid white;
660
+ background-color: #fff;
661
+ display: block;
662
+ transition: background-color 0.1s ease;
663
+ cursor: pointer;
664
+ outline: none;
665
+ border-radius: 8px;
666
+ padding: 3px;
667
+ }
668
+
669
+ #block-controls button:hover {
670
+ background-color: #efefef;
671
+ }
672
+
673
+ #block-controls button:focus-visible {
674
+ border-color: blue;
675
+ }
676
+
677
+ #block-controls span.block-type {
678
+ background-size: contain;
679
+ display: block;
680
+ width: 18px;
681
+ height: 18px;
682
+ margin: 2px;
683
+ }
684
+
685
+ #block-controls span.block-type.paragraph {
686
+ background-image: url(images/icons/text-paragraph.svg);
687
+ }
688
+
689
+ #block-controls span.block-type.h1 {
690
+ background-image: url(images/icons/type-h1.svg);
691
+ }
692
+
693
+ #block-controls span.block-type.h2 {
694
+ background-image: url(images/icons/type-h2.svg);
695
+ }
696
+
697
+ #block-controls span.block-type.quote {
698
+ background-image: url(images/icons/chat-square-quote.svg);
699
+ }
700
+
701
+ #block-controls span.block-type.ul {
702
+ background-image: url(images/icons/list-ul.svg);
703
+ }
704
+
705
+ #block-controls span.block-type.ol {
706
+ background-image: url(images/icons/list-ol.svg);
707
+ }
708
+
709
+ #block-controls span.block-type.code {
710
+ background-image: url(images/icons/code.svg);
711
+ }
712
+
713
+ .characters-limit {
714
+ color: #888;
715
+ font-size: 12px;
716
+ text-align: right;
717
+ display: block;
718
+ position: absolute;
719
+ left: 12px;
720
+ bottom: 5px;
721
+ }
722
+
723
+ .characters-limit.characters-limit-exceeded {
724
+ color: red;
725
+ }
726
+
727
+ .dropdown {
728
+ z-index: 10;
729
+ display: block;
730
+ position: fixed;
731
+ box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1),
732
+ inset 0 0 0 1px rgba(255, 255, 255, 0.5);
733
+ border-radius: 8px;
734
+ min-height: 40px;
735
+ background-color: #fff;
736
+ }
737
+
738
+ .dropdown .item {
739
+ margin: 0 8px 0 8px;
740
+ padding: 8px;
741
+ color: #050505;
742
+ cursor: pointer;
743
+ line-height: 16px;
744
+ font-size: 15px;
745
+ display: flex;
746
+ align-content: center;
747
+ flex-direction: row;
748
+ flex-shrink: 0;
749
+ justify-content: space-between;
750
+ background-color: #fff;
751
+ border-radius: 8px;
752
+ border: 0;
753
+ max-width: 250px;
754
+ min-width: 100px;
755
+ }
756
+
757
+ .dropdown .item.fontsize-item,
758
+ .dropdown .item.fontsize-item .text {
759
+ min-width: unset;
760
+ }
761
+
762
+ .dropdown .item .active {
763
+ display: flex;
764
+ width: 20px;
765
+ height: 20px;
766
+ background-size: contain;
767
+ }
768
+
769
+ .dropdown .item:first-child {
770
+ margin-top: 8px;
771
+ }
772
+
773
+ .dropdown .item:last-child {
774
+ margin-bottom: 8px;
775
+ }
776
+
777
+ .dropdown .item:hover {
778
+ background-color: #eee;
779
+ }
780
+
781
+ .dropdown .item .text {
782
+ display: flex;
783
+ line-height: 20px;
784
+ flex-grow: 1;
785
+ min-width: 150px;
786
+ }
787
+
788
+ .dropdown .item .icon {
789
+ display: flex;
790
+ width: 20px;
791
+ height: 20px;
792
+ user-select: none;
793
+ margin-right: 12px;
794
+ line-height: 16px;
795
+ background-size: contain;
796
+ background-position: center;
797
+ background-repeat: no-repeat;
798
+ }
799
+
800
+ .dropdown .divider {
801
+ width: auto;
802
+ background-color: #eee;
803
+ margin: 4px 8px;
804
+ height: 1px;
805
+ }
806
+
807
+ @media screen and (max-width: 1100px) {
808
+ .dropdown-button-text {
809
+ display: none !important;
810
+ }
811
+ .font-size .dropdown-button-text {
812
+ display: flex !important;
813
+ }
814
+ .code-language .dropdown-button-text {
815
+ display: flex !important;
816
+ }
817
+ }
818
+
819
+ .icon.paragraph {
820
+ background-image: url(images/icons/text-paragraph.svg);
821
+ }
822
+
823
+ .icon.h1 {
824
+ background-image: url(images/icons/type-h1.svg);
825
+ }
826
+
827
+ .icon.h2 {
828
+ background-image: url(images/icons/type-h2.svg);
829
+ }
830
+
831
+ .icon.h3 {
832
+ background-image: url(images/icons/type-h3.svg);
833
+ }
834
+
835
+ .icon.h4 {
836
+ background-image: url(images/icons/type-h4.svg);
837
+ }
838
+
839
+ .icon.h5 {
840
+ background-image: url(images/icons/type-h5.svg);
841
+ }
842
+
843
+ .icon.h6 {
844
+ background-image: url(images/icons/type-h6.svg);
845
+ }
846
+
847
+ .icon.bullet-list,
848
+ .icon.bullet {
849
+ background-image: url(images/icons/list-ul.svg);
850
+ }
851
+
852
+ .icon.check-list,
853
+ .icon.check {
854
+ background-image: url(images/icons/square-check.svg);
855
+ }
856
+
857
+ .icon.numbered-list,
858
+ .icon.number {
859
+ background-image: url(images/icons/list-ol.svg);
860
+ }
861
+
862
+ .icon.quote {
863
+ background-image: url(images/icons/chat-square-quote.svg);
864
+ }
865
+
866
+ .icon.code {
867
+ background-image: url(images/icons/code.svg);
868
+ }
869
+
870
+ .switches {
871
+ z-index: 6;
872
+ position: fixed;
873
+ left: 10px;
874
+ bottom: 70px;
875
+ animation: slide-in 0.4s ease;
876
+ }
877
+
878
+ @keyframes slide-in {
879
+ 0% {
880
+ opacity: 0;
881
+ transform: translateX(-200px);
882
+ }
883
+ 100% {
884
+ opacity: 1;
885
+ transform: translateX(0);
886
+ }
887
+ }
888
+
889
+ .switch {
890
+ display: block;
891
+ color: #444;
892
+ margin: 5px 0;
893
+ background-color: rgba(238, 238, 238, 0.7);
894
+ padding: 5px 10px;
895
+ border-radius: 10px;
896
+ }
897
+
898
+ #rich-text-switch {
899
+ right: 0;
900
+ }
901
+
902
+ #character-count-switch {
903
+ right: 130px;
904
+ }
905
+
906
+ .switch label {
907
+ margin-right: 5px;
908
+ line-height: 24px;
909
+ width: 100px;
910
+ font-size: 14px;
911
+ display: inline-block;
912
+ vertical-align: middle;
913
+ }
914
+
915
+ .switch button {
916
+ background-color: rgb(206, 208, 212);
917
+ height: 24px;
918
+ box-sizing: border-box;
919
+ border-radius: 12px;
920
+ width: 44px;
921
+ display: inline-block;
922
+ vertical-align: middle;
923
+ position: relative;
924
+ outline: none;
925
+ cursor: pointer;
926
+ transition: background-color 0.1s;
927
+ border: 2px solid transparent;
928
+ }
929
+
930
+ .switch button:focus-visible {
931
+ border-color: blue;
932
+ }
933
+
934
+ .switch button span {
935
+ top: 0px;
936
+ left: 0px;
937
+ display: block;
938
+ position: absolute;
939
+ width: 20px;
940
+ height: 20px;
941
+ border-radius: 12px;
942
+ background-color: white;
943
+ transition: transform 0.2s;
944
+ }
945
+
946
+ .switch button[aria-checked='true'] {
947
+ background-color: rgb(24, 119, 242);
948
+ }
949
+
950
+ .switch button[aria-checked='true'] span {
951
+ transform: translateX(20px);
952
+ }
953
+
954
+ .keyword {
955
+ color: rgb(241, 118, 94);
956
+ font-weight: bold;
957
+ }
958
+
959
+ .actions i.indent {
960
+ background-image: url(images/icons/indent.svg);
961
+ }
962
+
963
+ .actions i.outdent {
964
+ background-image: url(images/icons/outdent.svg);
965
+ }
966
+
967
+ .actions i.lock {
968
+ background-image: url(images/icons/lock-fill.svg);
969
+ }
970
+
971
+ .actions i.image {
972
+ background-image: url(images/icons/file-image.svg);
973
+ }
974
+
975
+ .actions i.table {
976
+ background-image: url(images/icons/table.svg);
977
+ }
978
+
979
+ .actions i.unlock {
980
+ background-image: url(images/icons/lock.svg);
981
+ }
982
+
983
+ .actions i.left-align {
984
+ background-image: url(images/icons/text-left.svg);
985
+ }
986
+
987
+ .actions i.center-align {
988
+ background-image: url(images/icons/text-center.svg);
989
+ }
990
+
991
+ .actions i.right-align {
992
+ background-image: url(images/icons/text-right.svg);
993
+ }
994
+
995
+ .actions i.justify-align {
996
+ background-image: url(images/icons/justify.svg);
997
+ }
998
+
999
+ .actions i.disconnect {
1000
+ background-image: url(images/icons/plug.svg);
1001
+ }
1002
+
1003
+ .actions i.connect {
1004
+ background-image: url(images/icons/plug-fill.svg);
1005
+ }
1006
+
1007
+ table.disable-selection {
1008
+ -webkit-touch-callout: none;
1009
+ -webkit-user-select: none;
1010
+ -khtml-user-select: none;
1011
+ -moz-user-select: none;
1012
+ -ms-user-select: none;
1013
+ user-select: none;
1014
+ }
1015
+
1016
+ table.disable-selection span::selection {
1017
+ background-color: transparent;
1018
+ }
1019
+
1020
+ table.disable-selection br::selection {
1021
+ background-color: transparent;
1022
+ }
1023
+
1024
+ .table-cell-action-button-container {
1025
+ position: absolute;
1026
+ top: 0;
1027
+ left: 0;
1028
+ will-change: transform;
1029
+ }
1030
+
1031
+ .table-cell-action-button {
1032
+ background-color: none;
1033
+ display: flex;
1034
+ justify-content: center;
1035
+ align-items: center;
1036
+ border: 0;
1037
+ position: relative;
1038
+ border-radius: 15px;
1039
+ color: #222;
1040
+ display: inline-block;
1041
+ cursor: pointer;
1042
+ }
1043
+
1044
+ i.chevron-down {
1045
+ background-color: transparent;
1046
+ background-size: contain;
1047
+ display: inline-block;
1048
+ height: 8px;
1049
+ width: 8px;
1050
+ background-image: url(images/icons/chevron-down.svg);
1051
+ }
1052
+
1053
+ .action-button {
1054
+ background-color: #eee;
1055
+ border: 0;
1056
+ padding: 8px 12px;
1057
+ position: relative;
1058
+ margin-left: 5px;
1059
+ border-radius: 15px;
1060
+ color: #222;
1061
+ display: inline-block;
1062
+ cursor: pointer;
1063
+ }
1064
+
1065
+ .action-button:hover {
1066
+ background-color: #ddd;
1067
+ color: #000;
1068
+ }
1069
+
1070
+ .action-button-mic.active {
1071
+ animation: mic-pulsate-color 3s infinite;
1072
+ }
1073
+ button.action-button:disabled {
1074
+ opacity: 0.6;
1075
+ background: #eee;
1076
+ cursor: not-allowed;
1077
+ }
1078
+
1079
+ @keyframes mic-pulsate-color {
1080
+ 0% {
1081
+ background-color: #ffdcdc;
1082
+ }
1083
+ 50% {
1084
+ background-color: #ff8585;
1085
+ }
1086
+ 100% {
1087
+ background-color: #ffdcdc;
1088
+ }
1089
+ }
1090
+
1091
+ .debug-timetravel-panel {
1092
+ overflow: hidden;
1093
+ padding: 0 0 10px 0;
1094
+ margin: auto;
1095
+ display: flex;
1096
+ }
1097
+
1098
+ .debug-timetravel-panel-slider {
1099
+ padding: 0;
1100
+ flex: 8;
1101
+ }
1102
+
1103
+ .debug-timetravel-panel-button {
1104
+ padding: 0;
1105
+ border: 0;
1106
+ background: none;
1107
+ flex: 1;
1108
+ color: #fff;
1109
+ font-size: 12px;
1110
+ }
1111
+
1112
+ .debug-timetravel-panel-button:hover {
1113
+ text-decoration: underline;
1114
+ }
1115
+
1116
+ .debug-timetravel-button {
1117
+ border: 0;
1118
+ padding: 0;
1119
+ font-size: 12px;
1120
+ top: 10px;
1121
+ right: 15px;
1122
+ position: absolute;
1123
+ background: none;
1124
+ color: #fff;
1125
+ }
1126
+
1127
+ .debug-timetravel-button:hover {
1128
+ text-decoration: underline;
1129
+ }
1130
+
1131
+ .connecting {
1132
+ font-size: 15px;
1133
+ color: #999;
1134
+ overflow: hidden;
1135
+ position: absolute;
1136
+ text-overflow: ellipsis;
1137
+ top: 10px;
1138
+ left: 10px;
1139
+ user-select: none;
1140
+ white-space: nowrap;
1141
+ display: inline-block;
1142
+ pointer-events: none;
1143
+ }
1144
+
1145
+ .ltr {
1146
+ text-align: left;
1147
+ }
1148
+
1149
+ .rtl {
1150
+ text-align: right;
1151
+ }
1152
+
1153
+ .toolbar {
1154
+ @apply flex h-12 w-full justify-between overflow-auto rounded-tl-md rounded-tr-md py-1 pr-2 pl-4 align-middle;
1155
+ }
1156
+
1157
+ .toolbar button.toolbar-item {
1158
+ @apply flex shrink-0 cursor-pointer items-center justify-between rounded-md border-0 bg-transparent p-2 align-middle;
1159
+ }
1160
+
1161
+ .toolbar button.toolbar-item:disabled {
1162
+ @apply cursor-not-allowed;
1163
+ }
1164
+
1165
+ .toolbar button.toolbar-item.spaced {
1166
+ @apply mr-0.5;
1167
+ }
1168
+
1169
+ .toolbar button.toolbar-item i.format {
1170
+ background-size: contain;
1171
+ display: inline-block;
1172
+ height: 18px;
1173
+ width: 18px;
1174
+ vertical-align: -0.25em;
1175
+ display: flex;
1176
+ opacity: 0.6;
1177
+ }
1178
+
1179
+ .toolbar button.toolbar-item:disabled .icon,
1180
+ .toolbar button.toolbar-item:disabled .text,
1181
+ .toolbar button.toolbar-item:disabled i.format,
1182
+ .toolbar button.toolbar-item:disabled .chevron-down {
1183
+ opacity: 0.2;
1184
+ }
1185
+
1186
+ .toolbar button.toolbar-item.active {
1187
+ @apply bg-purple-50-900;
1188
+ }
1189
+
1190
+ .toolbar button.toolbar-item.active i {
1191
+ opacity: 1;
1192
+ }
1193
+
1194
+ .toolbar .toolbar-item:hover:not([disabled]) {
1195
+ @apply bg-purple-50-900;
1196
+ }
1197
+
1198
+ .toolbar .toolbar-item.font-family .text {
1199
+ display: block;
1200
+ max-width: 40px;
1201
+ }
1202
+
1203
+ .toolbar .code-language {
1204
+ width: 150px;
1205
+ }
1206
+
1207
+ .toolbar .toolbar-item .text {
1208
+ display: flex;
1209
+ line-height: 20px;
1210
+ vertical-align: middle;
1211
+ font-size: 14px;
1212
+ color: #777;
1213
+ text-overflow: ellipsis;
1214
+ overflow: hidden;
1215
+ height: 20px;
1216
+ text-align: left;
1217
+ padding-right: 10px;
1218
+ }
1219
+
1220
+ .toolbar .toolbar-item .icon {
1221
+ display: flex;
1222
+ width: 20px;
1223
+ height: 20px;
1224
+ user-select: none;
1225
+ margin-right: 8px;
1226
+ line-height: 16px;
1227
+ background-size: contain;
1228
+ }
1229
+
1230
+ .toolbar i.chevron-down {
1231
+ margin-top: 3px;
1232
+ width: 16px;
1233
+ height: 16px;
1234
+ display: flex;
1235
+ user-select: none;
1236
+ }
1237
+
1238
+ .toolbar i.chevron-down.inside {
1239
+ width: 16px;
1240
+ height: 16px;
1241
+ display: flex;
1242
+ margin-left: -25px;
1243
+ margin-top: 11px;
1244
+ margin-right: 10px;
1245
+ pointer-events: none;
1246
+ }
1247
+
1248
+ .toolbar .divider {
1249
+ width: 1px;
1250
+ background-color: #eee;
1251
+ margin: 0 4px;
1252
+ }
1253
+
1254
+ .github-corner:hover .octo-arm {
1255
+ animation: octocat-wave 560ms ease-in-out;
1256
+ }
1257
+ @keyframes octocat-wave {
1258
+ 0%,
1259
+ 100% {
1260
+ transform: rotate(0);
1261
+ }
1262
+ 20%,
1263
+ 60% {
1264
+ transform: rotate(-25deg);
1265
+ }
1266
+ 40%,
1267
+ 80% {
1268
+ transform: rotate(10deg);
1269
+ }
1270
+ }
1271
+ @media (max-width: 500px) {
1272
+ .github-corner:hover .octo-arm {
1273
+ animation: none;
1274
+ }
1275
+ .github-corner .octo-arm {
1276
+ animation: octocat-wave 560ms ease-in-out;
1277
+ }
1278
+ }
1279
+
1280
+ .spacer {
1281
+ letter-spacing: -2px;
1282
+ }
1283
+
1284
+ button.item i {
1285
+ opacity: 0.6;
1286
+ }
1287
+
1288
+ button.item.dropdown-item-active {
1289
+ background-color: rgba(223, 232, 250, 0.3);
1290
+ }
1291
+
1292
+ button.item.dropdown-item-active i {
1293
+ opacity: 1;
1294
+ }
1295
+
1296
+ hr {
1297
+ padding: 4px 0;
1298
+ border: 1px solid red;
1299
+ border: none;
1300
+ margin: 1em 0;
1301
+ cursor: pointer;
1302
+ }
1303
+
1304
+ hr:after {
1305
+ content: '';
1306
+ display: block;
1307
+ height: 1px;
1308
+ background-color: #ccc;
1309
+ line-height: 1px;
1310
+ @apply bg-purple-100-800;
1311
+ }
1312
+
1313
+ hr.selected {
1314
+ outline: 2px solid rgb(60, 132, 244);
1315
+ user-select: none;
1316
+ }
1317
+
1318
+ .TableNode__contentEditable {
1319
+ min-height: 20px;
1320
+ border: 0px;
1321
+ resize: none;
1322
+ min-height: 100%;
1323
+ cursor: text;
1324
+ display: block;
1325
+ position: relative;
1326
+ tab-size: 1;
1327
+ outline: 0px;
1328
+ padding: 0;
1329
+ user-select: text;
1330
+ font-size: 15px;
1331
+ white-space: pre-wrap;
1332
+ word-break: break-word;
1333
+ z-index: 3;
1334
+ }
1335
+
1336
+ .TableNode__contentEditable .PlaygroundEditorTheme__paragraph {
1337
+ @apply mt-0;
1338
+ }
1339
+
1340
+ .PlaygroundEditorTheme__blockCursor {
1341
+ display: block;
1342
+ pointer-events: none;
1343
+ position: absolute;
1344
+ }
1345
+
1346
+ .PlaygroundEditorTheme__blockCursor:after {
1347
+ content: '';
1348
+ display: block;
1349
+ position: absolute;
1350
+ top: -2px;
1351
+ width: 20px;
1352
+ border-top: 1px solid black;
1353
+ animation: CursorBlink 1.1s steps(2, start) infinite;
1354
+ }
1355
+
1356
+ @keyframes CursorBlink {
1357
+ to {
1358
+ visibility: hidden;
1359
+ }
1360
+ }
1361
+ }