@placeholderco/placeholder-ui 1.0.11 → 2.0.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 (289) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +134 -130
  3. package/dist/app.css +178 -0
  4. package/dist/bootstrap.min.css +3600 -0
  5. package/dist/cards/GitCard.svelte +115 -0
  6. package/dist/cards/GitCard.svelte.d.ts +22 -0
  7. package/dist/display/Avatar.svelte +29 -17
  8. package/dist/display/Avatar.svelte.d.ts +12 -2
  9. package/dist/display/LinkCollection.svelte +40 -18
  10. package/dist/display/LinkCollection.svelte.d.ts +9 -2
  11. package/dist/display/Paper.svelte +31 -19
  12. package/dist/display/Paper.svelte.d.ts +12 -3
  13. package/dist/display/alert/Alert.svelte +129 -0
  14. package/dist/display/alert/Alert.svelte.d.ts +15 -0
  15. package/dist/display/alert/AlertVariant.d.ts +1 -0
  16. package/dist/display/alert/AlertVariant.js +1 -0
  17. package/dist/display/filetree/FileTree.svelte +259 -0
  18. package/dist/display/filetree/FileTree.svelte.d.ts +76 -0
  19. package/dist/display/filetree/FileTreeItem.svelte +396 -0
  20. package/dist/display/filetree/FileTreeItem.svelte.d.ts +40 -0
  21. package/dist/display/filetree/FileTreeNode.d.ts +46 -0
  22. package/dist/display/filetree/FileTreeNode.js +115 -0
  23. package/dist/display/filetree/index.d.ts +5 -0
  24. package/dist/display/filetree/index.js +3 -0
  25. package/dist/editors/CodeMirror.svelte +306 -0
  26. package/dist/editors/CodeMirror.svelte.d.ts +31 -0
  27. package/dist/editors/tiptap/LinkActionMenu.svelte +307 -0
  28. package/dist/editors/tiptap/LinkActionMenu.svelte.d.ts +8 -0
  29. package/dist/editors/tiptap/TipTap.svelte +856 -0
  30. package/dist/editors/tiptap/TipTap.svelte.d.ts +54 -0
  31. package/dist/editors/tiptap/TipTapBubble.svelte +790 -0
  32. package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +44 -0
  33. package/dist/editors/tiptap/collaboration.d.ts +55 -0
  34. package/dist/editors/tiptap/collaboration.js +1 -0
  35. package/dist/editors/tiptap/extensions/Alert.d.ts +18 -0
  36. package/dist/editors/tiptap/extensions/Alert.js +72 -0
  37. package/dist/editors/tiptap/extensions/CodeBlockEditor.d.ts +21 -0
  38. package/dist/editors/tiptap/extensions/CodeBlockEditor.js +326 -0
  39. package/dist/editors/tiptap/extensions/Div.d.ts +19 -0
  40. package/dist/editors/tiptap/extensions/Div.js +89 -0
  41. package/dist/editors/tiptap/extensions/Span.d.ts +5 -0
  42. package/dist/editors/tiptap/extensions/Span.js +56 -0
  43. package/dist/editors/tiptap/extensions/codeBlockEditor.css +236 -0
  44. package/dist/editors/tiptap/extensions/codeBlockLanguages.d.ts +17 -0
  45. package/dist/editors/tiptap/extensions/codeBlockLanguages.js +124 -0
  46. package/dist/editors/tiptap/extensions/index.d.ts +7 -0
  47. package/dist/editors/tiptap/extensions/index.js +5 -0
  48. package/dist/editors/tiptap/toolbar/AlertButton.svelte +261 -0
  49. package/dist/editors/tiptap/toolbar/AlertButton.svelte.d.ts +7 -0
  50. package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +18 -0
  51. package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte.d.ts +7 -0
  52. package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +18 -0
  53. package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte.d.ts +7 -0
  54. package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +18 -0
  55. package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte.d.ts +7 -0
  56. package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +18 -0
  57. package/dist/editors/tiptap/toolbar/AlignRightButton.svelte.d.ts +7 -0
  58. package/dist/editors/tiptap/toolbar/BoldButton.svelte +18 -0
  59. package/dist/editors/tiptap/toolbar/BoldButton.svelte.d.ts +7 -0
  60. package/dist/editors/tiptap/toolbar/BulletListButton.svelte +18 -0
  61. package/dist/editors/tiptap/toolbar/BulletListButton.svelte.d.ts +7 -0
  62. package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte +18 -0
  63. package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte.d.ts +7 -0
  64. package/dist/editors/tiptap/toolbar/CodeButton.svelte +18 -0
  65. package/dist/editors/tiptap/toolbar/CodeButton.svelte.d.ts +7 -0
  66. package/dist/editors/tiptap/toolbar/ColorButton.svelte +299 -0
  67. package/dist/editors/tiptap/toolbar/ColorButton.svelte.d.ts +20 -0
  68. package/dist/editors/tiptap/toolbar/DocumentButton.svelte +58 -0
  69. package/dist/editors/tiptap/toolbar/DocumentButton.svelte.d.ts +9 -0
  70. package/dist/editors/tiptap/toolbar/HeadingButton.svelte +30 -0
  71. package/dist/editors/tiptap/toolbar/HeadingButton.svelte.d.ts +8 -0
  72. package/dist/editors/tiptap/toolbar/HtmlButton.svelte +68 -0
  73. package/dist/editors/tiptap/toolbar/HtmlButton.svelte.d.ts +7 -0
  74. package/dist/editors/tiptap/toolbar/ImageButton.svelte +54 -0
  75. package/dist/editors/tiptap/toolbar/ImageButton.svelte.d.ts +8 -0
  76. package/dist/editors/tiptap/toolbar/ItalicButton.svelte +18 -0
  77. package/dist/editors/tiptap/toolbar/ItalicButton.svelte.d.ts +7 -0
  78. package/dist/editors/tiptap/toolbar/LinkButton.svelte +257 -0
  79. package/dist/editors/tiptap/toolbar/LinkButton.svelte.d.ts +7 -0
  80. package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +18 -0
  81. package/dist/editors/tiptap/toolbar/OrderedListButton.svelte.d.ts +7 -0
  82. package/dist/editors/tiptap/toolbar/RedoButton.svelte +18 -0
  83. package/dist/editors/tiptap/toolbar/RedoButton.svelte.d.ts +7 -0
  84. package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +18 -0
  85. package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte.d.ts +7 -0
  86. package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +18 -0
  87. package/dist/editors/tiptap/toolbar/SubscriptButton.svelte.d.ts +7 -0
  88. package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +18 -0
  89. package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte.d.ts +7 -0
  90. package/dist/editors/tiptap/toolbar/TableButton.svelte +258 -0
  91. package/dist/editors/tiptap/toolbar/TableButton.svelte.d.ts +7 -0
  92. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +84 -0
  93. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte.d.ts +10 -0
  94. package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +18 -0
  95. package/dist/editors/tiptap/toolbar/UnderlineButton.svelte.d.ts +7 -0
  96. package/dist/editors/tiptap/toolbar/UndoButton.svelte +18 -0
  97. package/dist/editors/tiptap/toolbar/UndoButton.svelte.d.ts +7 -0
  98. package/dist/form/Autocomplete.svelte +270 -137
  99. package/dist/form/Autocomplete.svelte.d.ts +58 -10
  100. package/dist/form/AutocompleteMulti.svelte +385 -227
  101. package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
  102. package/dist/form/Checkbox.svelte +124 -43
  103. package/dist/form/Checkbox.svelte.d.ts +26 -2
  104. package/dist/form/Chips.svelte +47 -17
  105. package/dist/form/Chips.svelte.d.ts +24 -3
  106. package/dist/form/ComboBox.svelte +30 -20
  107. package/dist/form/ComboBox.svelte.d.ts +1 -1
  108. package/dist/form/ComboBoxItemBuilder.svelte +161 -188
  109. package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
  110. package/dist/form/ComboBoxMulti.svelte +38 -24
  111. package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
  112. package/dist/form/CronBuilder.svelte +84 -67
  113. package/dist/form/CronBuilder.svelte.d.ts +16 -3
  114. package/dist/form/DatePicker.svelte +177 -191
  115. package/dist/form/DatePicker.svelte.d.ts +17 -2
  116. package/dist/form/DateRangePicker.svelte +775 -0
  117. package/dist/form/DateRangePicker.svelte.d.ts +23 -0
  118. package/dist/form/DateTimePicker.svelte +168 -209
  119. package/dist/form/DateTimePicker.svelte.d.ts +10 -2
  120. package/dist/form/FormGroup.svelte +33 -10
  121. package/dist/form/FormGroup.svelte.d.ts +12 -2
  122. package/dist/form/Number.svelte +71 -29
  123. package/dist/form/Number.svelte.d.ts +39 -6
  124. package/dist/form/Radio.svelte +174 -0
  125. package/dist/form/Radio.svelte.d.ts +21 -0
  126. package/dist/form/RadioGroup.svelte +52 -138
  127. package/dist/form/RadioGroup.svelte.d.ts +19 -2
  128. package/dist/form/SegmentedControl.svelte +103 -57
  129. package/dist/form/SegmentedControl.svelte.d.ts +12 -2
  130. package/dist/form/Select.svelte +160 -229
  131. package/dist/form/Select.svelte.d.ts +35 -6
  132. package/dist/form/SelectMulti.svelte +166 -277
  133. package/dist/form/SelectMulti.svelte.d.ts +37 -6
  134. package/dist/form/Slider.svelte +185 -268
  135. package/dist/form/Slider.svelte.d.ts +33 -16
  136. package/dist/form/StringArrayBuilder.svelte +249 -0
  137. package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
  138. package/dist/form/Switch.svelte +164 -106
  139. package/dist/form/Switch.svelte.d.ts +22 -3
  140. package/dist/form/TextArea.svelte +80 -45
  141. package/dist/form/TextArea.svelte.d.ts +35 -10
  142. package/dist/form/Textbox.svelte +80 -47
  143. package/dist/form/Textbox.svelte.d.ts +41 -8
  144. package/dist/form/TimePicker.svelte +42 -47
  145. package/dist/form/TimePicker.svelte.d.ts +12 -2
  146. package/dist/form/comboBoxCore.svelte.d.ts +99 -0
  147. package/dist/form/comboBoxCore.svelte.js +243 -0
  148. package/dist/icon/Icon.svelte +8 -3
  149. package/dist/icon/Icon.svelte.d.ts +8 -3
  150. package/dist/icon/cube-send.svg +1 -0
  151. package/dist/icon/file-type-bmp.svg +1 -0
  152. package/dist/icon/file-type-csv.svg +1 -0
  153. package/dist/icon/file-type-doc.svg +1 -0
  154. package/dist/icon/file-type-docx.svg +1 -0
  155. package/dist/icon/file-type-jpg.svg +1 -0
  156. package/dist/icon/file-type-pdf.svg +1 -0
  157. package/dist/icon/file-type-png.svg +1 -0
  158. package/dist/icon/file-type-ppt.svg +1 -0
  159. package/dist/icon/file-type-svg.svg +1 -0
  160. package/dist/icon/file-type-txt.svg +1 -0
  161. package/dist/icon/file-type-xls.svg +1 -0
  162. package/dist/icon/file-type-zip.svg +1 -0
  163. package/dist/icon/index.d.ts +166 -145
  164. package/dist/icon/index.js +166 -146
  165. package/dist/icon/layout-sidebar-left-collapse.svg +1 -0
  166. package/dist/icon/layout-sidebar-left-expand.svg +1 -0
  167. package/dist/icon/logo-placeholder.svg +6 -0
  168. package/dist/icon/paperclip.svg +1 -0
  169. package/dist/icon/source-code.svg +1 -0
  170. package/dist/icon/sun-moon.svg +1 -0
  171. package/dist/icon/table.svg +6 -0
  172. package/dist/icon/thumb-down.svg +1 -0
  173. package/dist/icon/thumb-up.svg +1 -0
  174. package/dist/index.d.ts +93 -22
  175. package/dist/index.js +28 -27
  176. package/dist/layout/AppShell.svelte +12 -162
  177. package/dist/layout/AppShell.svelte.d.ts +6 -27
  178. package/dist/layout/CustomNavbar.svelte +9 -7
  179. package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
  180. package/dist/layout/Navbar.svelte +158 -110
  181. package/dist/layout/Navbar.svelte.d.ts +26 -12
  182. package/dist/layout/NavbarItemDisplay.svelte +2 -2
  183. package/dist/layout/NavbarItemView.svelte +182 -0
  184. package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
  185. package/dist/layout/Sidenav.svelte +280 -341
  186. package/dist/layout/Sidenav.svelte.d.ts +36 -4
  187. package/dist/models/ComboBoxItem.d.ts +2 -0
  188. package/dist/models/Employee.d.ts +53 -0
  189. package/dist/models/Employee.js +23 -0
  190. package/dist/models/Hyperlink.d.ts +3 -1
  191. package/dist/models/LinkCollectionItem.d.ts +3 -1
  192. package/dist/models/NavbarItem.d.ts +6 -2
  193. package/dist/theme.svelte.d.ts +0 -1
  194. package/dist/theme.svelte.js +46 -58
  195. package/dist/ui/Accordion.svelte +81 -242
  196. package/dist/ui/Accordion.svelte.d.ts +37 -14
  197. package/dist/ui/AccordionItem.svelte +303 -0
  198. package/dist/ui/AccordionItem.svelte.d.ts +21 -0
  199. package/dist/ui/ActionIcon.svelte +25 -21
  200. package/dist/ui/ActionIcon.svelte.d.ts +15 -2
  201. package/dist/ui/Badge.svelte +170 -161
  202. package/dist/ui/Badge.svelte.d.ts +16 -4
  203. package/dist/ui/Button.svelte +178 -205
  204. package/dist/ui/Button.svelte.d.ts +19 -2
  205. package/dist/ui/ButtonVariant.d.ts +15 -1
  206. package/dist/ui/ContextMenu.svelte +146 -0
  207. package/dist/ui/ContextMenu.svelte.d.ts +37 -0
  208. package/dist/ui/ContextMenuList.svelte +188 -0
  209. package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
  210. package/dist/ui/Dialog.svelte +183 -104
  211. package/dist/ui/Dialog.svelte.d.ts +21 -2
  212. package/dist/ui/Drawer.svelte +237 -184
  213. package/dist/ui/Drawer.svelte.d.ts +20 -2
  214. package/dist/ui/Dropdown.svelte +24 -14
  215. package/dist/ui/Dropdown.svelte.d.ts +11 -2
  216. package/dist/ui/Dropzone.svelte +159 -57
  217. package/dist/ui/Dropzone.svelte.d.ts +29 -2
  218. package/dist/ui/Link.svelte +12 -4
  219. package/dist/ui/Link.svelte.d.ts +8 -2
  220. package/dist/ui/Loader.svelte +23 -18
  221. package/dist/ui/Loader.svelte.d.ts +5 -2
  222. package/dist/ui/Logo.svelte +37 -0
  223. package/dist/ui/Logo.svelte.d.ts +16 -0
  224. package/dist/ui/MultiSortable.svelte +287 -0
  225. package/dist/ui/MultiSortable.svelte.d.ts +50 -0
  226. package/dist/ui/Pagination.svelte +12 -6
  227. package/dist/ui/Pagination.svelte.d.ts +6 -2
  228. package/dist/ui/Popover.svelte +43 -65
  229. package/dist/ui/Popover.svelte.d.ts +14 -5
  230. package/dist/ui/ProgressBar.svelte +169 -0
  231. package/dist/ui/ProgressBar.svelte.d.ts +30 -0
  232. package/dist/ui/ProgressBarVariant.d.ts +7 -0
  233. package/dist/ui/ProgressBarVariant.js +1 -0
  234. package/dist/ui/SegmentedControl.svelte +0 -0
  235. package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
  236. package/dist/ui/Sortable.svelte +163 -0
  237. package/dist/ui/Sortable.svelte.d.ts +47 -0
  238. package/dist/ui/Table.svelte +497 -56
  239. package/dist/ui/Table.svelte.d.ts +64 -2
  240. package/dist/ui/Tabs.svelte +22 -18
  241. package/dist/ui/Tabs.svelte.d.ts +6 -2
  242. package/dist/ui/ThemeSwitcher.svelte +26 -7
  243. package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
  244. package/dist/ui/Tooltip.svelte +312 -180
  245. package/dist/ui/Tooltip.svelte.d.ts +4 -3
  246. package/dist/uiTheme.svelte.d.ts +86 -0
  247. package/dist/uiTheme.svelte.js +214 -0
  248. package/dist/util/DateFunctions.js +1 -1
  249. package/dist/util/DragDrop.d.ts +50 -0
  250. package/dist/util/DragDrop.js +154 -0
  251. package/dist/util/NavigateTo.js +2 -2
  252. package/dist/util/dayjs.d.ts +4 -0
  253. package/dist/util/dayjs.js +15 -0
  254. package/dist/util/interceptLinkClick.d.ts +13 -0
  255. package/dist/util/interceptLinkClick.js +33 -0
  256. package/package.json +66 -26
  257. package/dist/display/Alert.svelte +0 -179
  258. package/dist/display/Alert.svelte.d.ts +0 -13
  259. package/dist/form/FileInput.svelte +0 -235
  260. package/dist/form/FileInput.svelte.d.ts +0 -23
  261. package/dist/form/PasswordInput.svelte +0 -252
  262. package/dist/form/PasswordInput.svelte.d.ts +0 -33
  263. package/dist/form/Rating.svelte +0 -235
  264. package/dist/form/Rating.svelte.d.ts +0 -21
  265. package/dist/styles/components.css +0 -199
  266. package/dist/styles/dark.css +0 -146
  267. package/dist/styles/index.css +0 -116
  268. package/dist/styles/reset.css +0 -110
  269. package/dist/styles/semantic.css +0 -86
  270. package/dist/styles/tokens.css +0 -203
  271. package/dist/styles/utilities.css +0 -523
  272. package/dist/ui/Breadcrumbs.svelte +0 -131
  273. package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
  274. package/dist/ui/LoadingOverlay.svelte +0 -53
  275. package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
  276. package/dist/ui/Progress.svelte +0 -191
  277. package/dist/ui/Progress.svelte.d.ts +0 -15
  278. package/dist/ui/RingProgress.svelte +0 -141
  279. package/dist/ui/RingProgress.svelte.d.ts +0 -18
  280. package/dist/ui/Skeleton.svelte +0 -85
  281. package/dist/ui/Skeleton.svelte.d.ts +0 -12
  282. package/dist/ui/Stepper.svelte +0 -355
  283. package/dist/ui/Stepper.svelte.d.ts +0 -24
  284. package/dist/ui/Timeline.svelte +0 -225
  285. package/dist/ui/Timeline.svelte.d.ts +0 -23
  286. /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
  287. /package/dist/{actions → util}/ClickOutside.js +0 -0
  288. /package/dist/{transitions → util}/Transitions.d.ts +0 -0
  289. /package/dist/{transitions → util}/Transitions.js +0 -0
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const AlertButton: import("svelte").Component<Props, {}, "">;
6
+ type AlertButton = ReturnType<typeof AlertButton>;
7
+ export default AlertButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconAlignCenter } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconAlignCenter}
15
+ title="Align Center"
16
+ active={editor.isActive({ textAlign: 'center' })}
17
+ onclick={() => editor.chain().focus().setTextAlign('center').run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const AlignCenterButton: import("svelte").Component<Props, {}, "">;
6
+ type AlignCenterButton = ReturnType<typeof AlignCenterButton>;
7
+ export default AlignCenterButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconAlignJustified } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconAlignJustified}
15
+ title="Justify"
16
+ active={editor.isActive({ textAlign: 'justify' })}
17
+ onclick={() => editor.chain().focus().setTextAlign('justify').run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const AlignJustifyButton: import("svelte").Component<Props, {}, "">;
6
+ type AlignJustifyButton = ReturnType<typeof AlignJustifyButton>;
7
+ export default AlignJustifyButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconAlignLeft } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconAlignLeft}
15
+ title="Align Left"
16
+ active={editor.isActive({ textAlign: 'left' })}
17
+ onclick={() => editor.chain().focus().setTextAlign('left').run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const AlignLeftButton: import("svelte").Component<Props, {}, "">;
6
+ type AlignLeftButton = ReturnType<typeof AlignLeftButton>;
7
+ export default AlignLeftButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconAlignRight } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconAlignRight}
15
+ title="Align Right"
16
+ active={editor.isActive({ textAlign: 'right' })}
17
+ onclick={() => editor.chain().focus().setTextAlign('right').run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const AlignRightButton: import("svelte").Component<Props, {}, "">;
6
+ type AlignRightButton = ReturnType<typeof AlignRightButton>;
7
+ export default AlignRightButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconBold } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconBold}
15
+ title="Bold"
16
+ active={editor.isActive('bold')}
17
+ onclick={() => editor.chain().focus().toggleBold().run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const BoldButton: import("svelte").Component<Props, {}, "">;
6
+ type BoldButton = ReturnType<typeof BoldButton>;
7
+ export default BoldButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconList } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconList}
15
+ title="Bullet List"
16
+ active={editor.isActive('bulletList')}
17
+ onclick={() => editor.chain().focus().toggleBulletList().run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const BulletListButton: import("svelte").Component<Props, {}, "">;
6
+ type BulletListButton = ReturnType<typeof BulletListButton>;
7
+ export default BulletListButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core';
3
+ import ToolbarButton from './ToolbarButton.svelte';
4
+ import { iconSourceCode } from '../../../icon/index.js';
5
+
6
+ interface Props {
7
+ editor: Editor;
8
+ }
9
+
10
+ let { editor }: Props = $props();
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconSourceCode}
15
+ title="Code Block"
16
+ active={editor.isActive('codeBlock')}
17
+ onclick={() => editor.chain().focus().toggleCodeBlock().run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const CodeBlockButton: import("svelte").Component<Props, {}, "">;
6
+ type CodeBlockButton = ReturnType<typeof CodeBlockButton>;
7
+ export default CodeBlockButton;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconCode } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ }
9
+
10
+ let { editor }: Props = $props()
11
+ </script>
12
+
13
+ <ToolbarButton
14
+ icon={iconCode}
15
+ title="Code"
16
+ active={editor.isActive('code')}
17
+ onclick={() => editor.chain().focus().toggleCode().run()}
18
+ />
@@ -0,0 +1,7 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ }
5
+ declare const CodeButton: import("svelte").Component<Props, {}, "">;
6
+ type CodeButton = ReturnType<typeof CodeButton>;
7
+ export default CodeButton;
@@ -0,0 +1,299 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconPalette } from '../../../icon/index.js'
5
+
6
+ export interface ColorSwatch {
7
+ /** CSS colour value applied to the text */
8
+ value: string
9
+ /** Accessible label / tooltip */
10
+ label: string
11
+ }
12
+
13
+ interface Props {
14
+ editor: Editor
15
+ /**
16
+ * Swatches shown under "Brand Colors". Defaults to the library's `--ui-*`
17
+ * tokens, so they follow whatever theme is applied.
18
+ */
19
+ brandColors?: ColorSwatch[]
20
+ }
21
+
22
+ /** Default brand swatches, resolved from the theme tokens at click time. */
23
+ export const defaultBrandColors: ColorSwatch[] = [
24
+ { value: 'var(--ui-primary)', label: 'Primary' },
25
+ { value: 'var(--ui-accent)', label: 'Accent' },
26
+ { value: 'var(--ui-accent-dark)', label: 'Accent Dark' },
27
+ { value: 'var(--ui-tertiary)', label: 'Tertiary' },
28
+ { value: 'var(--ui-tertiary-dark)', label: 'Tertiary Dark' }
29
+ ]
30
+
31
+ let { editor, brandColors = defaultBrandColors }: Props = $props()
32
+
33
+ /** Resolve `var(--x)` to a concrete colour so the stored HTML is portable. */
34
+ const resolveColor = (color: string) => {
35
+ const match = color.match(/^var\((--[^,)]+)/)
36
+ if (!match || typeof document === 'undefined') return color
37
+ const resolved = getComputedStyle(document.documentElement).getPropertyValue(match[1]).trim()
38
+ if (!resolved) return color
39
+ // Tokens such as `--ui-primary` are themselves `rgb(var(--ui-primary-rgb))`
40
+ const nested = resolved.match(/^rgb\(var\((--[^)]+)\)\)$/)
41
+ if (nested) {
42
+ const triplet = getComputedStyle(document.documentElement).getPropertyValue(nested[1]).trim()
43
+ return triplet ? `rgb(${triplet})` : color
44
+ }
45
+ return resolved
46
+ }
47
+
48
+ let showColorPicker = $state(false)
49
+ let colorPickerElement: HTMLDivElement | undefined = $state()
50
+ let selectedColor = $state('#000000')
51
+
52
+ const toggleColorPicker = () => {
53
+ const currentColor = editor.getAttributes('textStyle')?.color
54
+ if (currentColor) {
55
+ selectedColor = currentColor
56
+ }
57
+ showColorPicker = !showColorPicker
58
+ }
59
+
60
+ const applyColor = (color: string) => {
61
+ const resolved = resolveColor(color)
62
+ editor.chain().focus().setColor(resolved).run()
63
+ selectedColor = resolved
64
+ }
65
+
66
+ const removeColor = () => {
67
+ editor.chain().focus().unsetColor().run()
68
+ showColorPicker = false
69
+ }
70
+ </script>
71
+
72
+ <div style="position: relative; display: inline-block;">
73
+ <ToolbarButton
74
+ icon={iconPalette}
75
+ title="Text Color"
76
+ active={showColorPicker}
77
+ onclick={toggleColorPicker}
78
+ />
79
+
80
+ {#if showColorPicker}
81
+ <div class="color-picker-dropdown" bind:this={colorPickerElement}>
82
+ <!-- Brand Colors Section -->
83
+ <div class="color-section-title">Brand Colors</div>
84
+ <div class="color-preset-grid">
85
+ {#each brandColors as swatch}
86
+ <button
87
+ class="color-preset"
88
+ style="background: {swatch.value}"
89
+ onclick={() => applyColor(swatch.value)}
90
+ title={swatch.label}
91
+ aria-label={swatch.label}
92
+ ></button>
93
+ {/each}
94
+ </div>
95
+
96
+ <!-- Common Colors Section -->
97
+ <div class="color-section-title">Common Colors</div>
98
+ <div class="color-preset-grid">
99
+ <button
100
+ class="color-preset"
101
+ style="background: #000000"
102
+ onclick={() => applyColor('#000000')}
103
+ title="Black"
104
+ aria-label="Black"
105
+ ></button>
106
+ <button
107
+ class="color-preset"
108
+ style="background: #495057"
109
+ onclick={() => applyColor('#495057')}
110
+ title="Gray"
111
+ aria-label="Gray"
112
+ ></button>
113
+ <button
114
+ class="color-preset"
115
+ style="background: #fa5252"
116
+ onclick={() => applyColor('#fa5252')}
117
+ title="Red"
118
+ aria-label="Red"
119
+ ></button>
120
+ <button
121
+ class="color-preset"
122
+ style="background: #ff922b"
123
+ onclick={() => applyColor('#ff922b')}
124
+ title="Orange"
125
+ aria-label="Orange"
126
+ ></button>
127
+ <button
128
+ class="color-preset"
129
+ style="background: #fcc419"
130
+ onclick={() => applyColor('#fcc419')}
131
+ title="Yellow"
132
+ aria-label="Yellow"
133
+ ></button>
134
+ <button
135
+ class="color-preset"
136
+ style="background: #51cf66"
137
+ onclick={() => applyColor('#51cf66')}
138
+ title="Green"
139
+ aria-label="Green"
140
+ ></button>
141
+ <button
142
+ class="color-preset"
143
+ style="background: #22b8cf"
144
+ onclick={() => applyColor('#22b8cf')}
145
+ title="Cyan"
146
+ aria-label="Cyan"
147
+ ></button>
148
+ <button
149
+ class="color-preset"
150
+ style="background: #228be6"
151
+ onclick={() => applyColor('#228be6')}
152
+ title="Blue"
153
+ aria-label="Blue"
154
+ ></button>
155
+ <button
156
+ class="color-preset"
157
+ style="background: #9775fa"
158
+ onclick={() => applyColor('#9775fa')}
159
+ title="Purple"
160
+ aria-label="Purple"
161
+ ></button>
162
+ <button
163
+ class="color-preset"
164
+ style="background: #f06595"
165
+ onclick={() => applyColor('#f06595')}
166
+ title="Pink"
167
+ aria-label="Pink"
168
+ ></button>
169
+ </div>
170
+ <div class="color-input-row">
171
+ <input
172
+ type="color"
173
+ bind:value={selectedColor}
174
+ oninput={(e) => applyColor((e.target as HTMLInputElement).value)}
175
+ class="color-input"
176
+ title="Custom Color"
177
+ />
178
+ <button onclick={removeColor} class="color-remove-button" title="Remove Color">
179
+ Clear
180
+ </button>
181
+ </div>
182
+ </div>
183
+ {/if}
184
+ </div>
185
+
186
+ <style>
187
+ .color-picker-dropdown {
188
+ position: absolute;
189
+ top: 100%;
190
+ left: 0;
191
+ margin-top: 4px;
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: 8px;
195
+ padding: 12px;
196
+ background: var(--paper-body-bg);
197
+ border: 1px solid var(--border-color);
198
+ border-radius: 4px;
199
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
200
+ z-index: 1000;
201
+ min-width: 240px;
202
+ }
203
+
204
+ .color-section-title {
205
+ font-size: 11px;
206
+ font-weight: 600;
207
+ color: var(--text-muted);
208
+ text-transform: uppercase;
209
+ letter-spacing: 0.05em;
210
+ margin-top: 4px;
211
+ margin-bottom: 4px;
212
+ }
213
+
214
+ .color-section-title:first-child {
215
+ margin-top: 0;
216
+ }
217
+
218
+ :global(.dark) .color-picker-dropdown {
219
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
220
+ }
221
+
222
+ .color-preset-grid {
223
+ display: grid;
224
+ grid-template-columns: repeat(5, 1fr);
225
+ gap: 8px;
226
+ }
227
+
228
+ .color-preset {
229
+ width: 32px;
230
+ height: 32px;
231
+ border: 2px solid var(--border-color);
232
+ border-radius: 4px;
233
+ cursor: pointer;
234
+ transition: all 0.15s ease;
235
+ padding: 0;
236
+ }
237
+
238
+ .color-preset:hover {
239
+ border-color: var(--ui-primary);
240
+ transform: scale(1.1);
241
+ }
242
+
243
+ :global(.dark) .color-preset:hover {
244
+ border-color: var(--ui-accent);
245
+ }
246
+
247
+ .color-input-row {
248
+ display: flex;
249
+ gap: 8px;
250
+ align-items: center;
251
+ padding-top: 8px;
252
+ border-top: 1px solid var(--border-color);
253
+ }
254
+
255
+ .color-input {
256
+ flex: 1;
257
+ height: 36px;
258
+ border: 1px solid var(--border-color);
259
+ border-radius: 4px;
260
+ cursor: pointer;
261
+ padding: 2px;
262
+ background: var(--paper-body-bg);
263
+ }
264
+
265
+ .color-input::-webkit-color-swatch-wrapper {
266
+ padding: 2px;
267
+ }
268
+
269
+ .color-input::-webkit-color-swatch {
270
+ border: none;
271
+ border-radius: 2px;
272
+ }
273
+
274
+ .color-remove-button {
275
+ padding: 6px 12px;
276
+ border: none;
277
+ background: var(--ui-tertiary);
278
+ color: var(--ui-primary);
279
+ border-radius: 4px;
280
+ cursor: pointer;
281
+ font-size: 13px;
282
+ font-weight: 500;
283
+ transition: background 0.15s ease;
284
+ white-space: nowrap;
285
+ }
286
+
287
+ .color-remove-button:hover {
288
+ background: var(--ui-tertiary-dark);
289
+ }
290
+
291
+ :global(.dark) .color-remove-button {
292
+ background: var(--ui-accent);
293
+ color: var(--ui-primary);
294
+ }
295
+
296
+ :global(.dark) .color-remove-button:hover {
297
+ background: var(--ui-accent-dark);
298
+ }
299
+ </style>
@@ -0,0 +1,20 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ export interface ColorSwatch {
3
+ /** CSS colour value applied to the text */
4
+ value: string;
5
+ /** Accessible label / tooltip */
6
+ label: string;
7
+ }
8
+ interface Props {
9
+ editor: Editor;
10
+ /**
11
+ * Swatches shown under "Brand Colors". Defaults to the library's `--ui-*`
12
+ * tokens, so they follow whatever theme is applied.
13
+ */
14
+ brandColors?: ColorSwatch[];
15
+ }
16
+ declare const ColorButton: import("svelte").Component<Props, {
17
+ /** Default brand swatches, resolved from the theme tokens at click time. */ defaultBrandColors: ColorSwatch[];
18
+ }, "">;
19
+ type ColorButton = ReturnType<typeof ColorButton>;
20
+ export default ColorButton;
@@ -0,0 +1,58 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconPaperclip } from '../../../icon/index.js'
5
+ import type { DocumentUploadResult } from '../TipTap.svelte'
6
+
7
+ interface Props {
8
+ editor: Editor
9
+ onDocumentUpload?: (file: File) => Promise<DocumentUploadResult | null>
10
+ }
11
+
12
+ let { editor, onDocumentUpload }: Props = $props()
13
+
14
+ let fileInputElement: HTMLInputElement | undefined = $state()
15
+
16
+ const handleFileSelect = async (event: Event) => {
17
+ const target = event.target as HTMLInputElement
18
+ const file = target.files?.[0]
19
+
20
+ if (!file || !onDocumentUpload) return
21
+
22
+ try {
23
+ const result = await onDocumentUpload(file)
24
+
25
+ if (result) {
26
+ editor
27
+ .chain()
28
+ .focus()
29
+ .insertContent({
30
+ type: 'text',
31
+ text: result.label,
32
+ marks: [{ type: 'link', attrs: { href: result.url } }]
33
+ })
34
+ .run()
35
+ }
36
+ } catch (error) {
37
+ console.error('Failed to upload document:', error)
38
+ }
39
+
40
+ // Reset the input
41
+ if (fileInputElement) {
42
+ fileInputElement.value = ''
43
+ }
44
+ }
45
+
46
+ const openFilePicker = () => {
47
+ fileInputElement?.click()
48
+ }
49
+ </script>
50
+
51
+ <input
52
+ type="file"
53
+ bind:this={fileInputElement}
54
+ onchange={handleFileSelect}
55
+ style="display: none;"
56
+ />
57
+
58
+ <ToolbarButton icon={iconPaperclip} title="Attach Document" onclick={openFilePicker} />
@@ -0,0 +1,9 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ import type { DocumentUploadResult } from '../TipTap.svelte';
3
+ interface Props {
4
+ editor: Editor;
5
+ onDocumentUpload?: (file: File) => Promise<DocumentUploadResult | null>;
6
+ }
7
+ declare const DocumentButton: import("svelte").Component<Props, {}, "">;
8
+ type DocumentButton = ReturnType<typeof DocumentButton>;
9
+ export default DocumentButton;
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import type { Editor } from '@tiptap/core'
3
+ import ToolbarButton from './ToolbarButton.svelte'
4
+ import { iconH1, iconH2, iconH3, iconH4, iconH5, iconH6 } from '../../../icon/index.js'
5
+
6
+ interface Props {
7
+ editor: Editor
8
+ level?: 1 | 2 | 3 | 4 | 5 | 6
9
+ }
10
+
11
+ let { editor, level = 1 }: Props = $props()
12
+
13
+ const iconMap = {
14
+ 1: iconH1,
15
+ 2: iconH2,
16
+ 3: iconH3,
17
+ 4: iconH4,
18
+ 5: iconH5,
19
+ 6: iconH6
20
+ }
21
+
22
+ const icon = $derived(iconMap[level])
23
+ </script>
24
+
25
+ <ToolbarButton
26
+ {icon}
27
+ title="Heading {level}"
28
+ active={editor.isActive('heading', { level })}
29
+ onclick={() => editor.chain().focus().toggleHeading({ level }).run()}
30
+ />
@@ -0,0 +1,8 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ interface Props {
3
+ editor: Editor;
4
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
5
+ }
6
+ declare const HeadingButton: import("svelte").Component<Props, {}, "">;
7
+ type HeadingButton = ReturnType<typeof HeadingButton>;
8
+ export default HeadingButton;