@tulipfarm/sprout 0.0.0-stage → 0.2.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 (314) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +183 -2
  3. package/dist/components/accordion.d.ts +28 -0
  4. package/dist/components/accordion.js +26 -0
  5. package/dist/components/alert-dialog.d.ts +60 -0
  6. package/dist/components/alert-dialog.js +69 -0
  7. package/dist/components/alert.d.ts +30 -0
  8. package/dist/components/alert.js +35 -0
  9. package/dist/components/aspect-ratio.d.ts +7 -0
  10. package/dist/components/aspect-ratio.js +6 -0
  11. package/dist/components/attachment.d.ts +118 -0
  12. package/dist/components/attachment.js +285 -0
  13. package/dist/components/avatar.d.ts +32 -0
  14. package/dist/components/avatar.js +73 -0
  15. package/dist/components/badge.d.ts +21 -0
  16. package/dist/components/badge.js +27 -0
  17. package/dist/components/brand-icon.d.ts +28 -0
  18. package/dist/components/brand-icon.js +82 -0
  19. package/dist/components/breadcrumb.d.ts +29 -0
  20. package/dist/components/breadcrumb.js +44 -0
  21. package/dist/components/button-group.d.ts +28 -0
  22. package/dist/components/button-group.js +36 -0
  23. package/dist/components/button.d.ts +79 -0
  24. package/dist/components/button.js +93 -0
  25. package/dist/components/calendar.d.ts +27 -0
  26. package/dist/components/calendar.js +107 -0
  27. package/dist/components/canvas.d.ts +78 -0
  28. package/dist/components/canvas.js +180 -0
  29. package/dist/components/card.d.ts +43 -0
  30. package/dist/components/card.js +42 -0
  31. package/dist/components/carousel.d.ts +57 -0
  32. package/dist/components/carousel.js +422 -0
  33. package/dist/components/chart.d.ts +112 -0
  34. package/dist/components/chart.js +172 -0
  35. package/dist/components/chat-confirmation.d.ts +42 -0
  36. package/dist/components/chat-confirmation.js +62 -0
  37. package/dist/components/chat-input.d.ts +94 -0
  38. package/dist/components/chat-input.js +279 -0
  39. package/dist/components/chat-plan.d.ts +21 -0
  40. package/dist/components/chat-plan.js +35 -0
  41. package/dist/components/chat-sources.d.ts +64 -0
  42. package/dist/components/chat-sources.js +66 -0
  43. package/dist/components/checkbox.d.ts +16 -0
  44. package/dist/components/checkbox.js +17 -0
  45. package/dist/components/choice-list.d.ts +53 -0
  46. package/dist/components/choice-list.js +36 -0
  47. package/dist/components/code-block.d.ts +35 -0
  48. package/dist/components/code-block.js +64 -0
  49. package/dist/components/collapsible.d.ts +24 -0
  50. package/dist/components/collapsible.js +27 -0
  51. package/dist/components/combobox.d.ts +95 -0
  52. package/dist/components/combobox.js +106 -0
  53. package/dist/components/command.d.ts +94 -0
  54. package/dist/components/command.js +414 -0
  55. package/dist/components/context-menu.d.ts +57 -0
  56. package/dist/components/context-menu.js +60 -0
  57. package/dist/components/dialog.d.ts +60 -0
  58. package/dist/components/dialog.js +79 -0
  59. package/dist/components/direction.d.ts +6 -0
  60. package/dist/components/direction.js +6 -0
  61. package/dist/components/dropdown-menu.d.ts +62 -0
  62. package/dist/components/dropdown-menu.js +59 -0
  63. package/dist/components/field.d.ts +117 -0
  64. package/dist/components/field.js +150 -0
  65. package/dist/components/file-explorer.d.ts +27 -0
  66. package/dist/components/file-explorer.js +300 -0
  67. package/dist/components/file-viewer.d.ts +137 -0
  68. package/dist/components/file-viewer.js +400 -0
  69. package/dist/components/form.d.ts +87 -0
  70. package/dist/components/form.js +55 -0
  71. package/dist/components/glass-banner.d.ts +27 -0
  72. package/dist/components/glass-banner.js +116 -0
  73. package/dist/components/gradient-banner.d.ts +37 -0
  74. package/dist/components/gradient-banner.js +43 -0
  75. package/dist/components/hover-card.d.ts +27 -0
  76. package/dist/components/hover-card.js +26 -0
  77. package/dist/components/input-group.d.ts +68 -0
  78. package/dist/components/input-group.js +88 -0
  79. package/dist/components/input-otp.d.ts +38 -0
  80. package/dist/components/input-otp.js +43 -0
  81. package/dist/components/input.d.ts +16 -0
  82. package/dist/components/input.js +18 -0
  83. package/dist/components/kbd.d.ts +12 -0
  84. package/dist/components/kbd.js +11 -0
  85. package/dist/components/label.d.ts +8 -0
  86. package/dist/components/label.js +10 -0
  87. package/dist/components/mention-list.d.ts +54 -0
  88. package/dist/components/mention-list.js +31 -0
  89. package/dist/components/menubar.d.ts +64 -0
  90. package/dist/components/menubar.js +68 -0
  91. package/dist/components/message-actions.d.ts +34 -0
  92. package/dist/components/message-actions.js +68 -0
  93. package/dist/components/message-response.d.ts +20 -0
  94. package/dist/components/message-response.js +46 -0
  95. package/dist/components/message-scroller.d.ts +71 -0
  96. package/dist/components/message-scroller.js +217 -0
  97. package/dist/components/message.d.ts +49 -0
  98. package/dist/components/message.js +59 -0
  99. package/dist/components/navigation-menu.d.ts +45 -0
  100. package/dist/components/navigation-menu.js +54 -0
  101. package/dist/components/notice-banner.d.ts +14 -0
  102. package/dist/components/notice-banner.js +11 -0
  103. package/dist/components/page-content.d.ts +7 -0
  104. package/dist/components/page-content.js +9 -0
  105. package/dist/components/page-header.d.ts +37 -0
  106. package/dist/components/page-header.js +53 -0
  107. package/dist/components/pagination.d.ts +29 -0
  108. package/dist/components/pagination.js +29 -0
  109. package/dist/components/plan-outline.d.ts +60 -0
  110. package/dist/components/plan-outline.js +108 -0
  111. package/dist/components/popover.d.ts +34 -0
  112. package/dist/components/popover.js +35 -0
  113. package/dist/components/progress.d.ts +27 -0
  114. package/dist/components/progress.js +35 -0
  115. package/dist/components/prompt-list.d.ts +23 -0
  116. package/dist/components/prompt-list.js +11 -0
  117. package/dist/components/questionnaire.d.ts +148 -0
  118. package/dist/components/questionnaire.js +1002 -0
  119. package/dist/components/radio-group.d.ts +16 -0
  120. package/dist/components/radio-group.js +21 -0
  121. package/dist/components/reasoning-effort.d.ts +24 -0
  122. package/dist/components/reasoning-effort.js +269 -0
  123. package/dist/components/resizable.d.ts +67 -0
  124. package/dist/components/resizable.js +536 -0
  125. package/dist/components/result-card.d.ts +58 -0
  126. package/dist/components/result-card.js +88 -0
  127. package/dist/components/review-card.d.ts +62 -0
  128. package/dist/components/review-card.js +49 -0
  129. package/dist/components/rich-text-editor.d.ts +51 -0
  130. package/dist/components/rich-text-editor.js +248 -0
  131. package/dist/components/schema-diagram.d.ts +52 -0
  132. package/dist/components/schema-diagram.js +226 -0
  133. package/dist/components/scroll-area.d.ts +22 -0
  134. package/dist/components/scroll-area.js +19 -0
  135. package/dist/components/search-dialog.d.ts +103 -0
  136. package/dist/components/search-dialog.js +65 -0
  137. package/dist/components/search-field.d.ts +17 -0
  138. package/dist/components/search-field.js +27 -0
  139. package/dist/components/select.d.ts +57 -0
  140. package/dist/components/select.js +57 -0
  141. package/dist/components/selection-slot.d.ts +18 -0
  142. package/dist/components/selection-slot.js +53 -0
  143. package/dist/components/separator.d.ts +48 -0
  144. package/dist/components/separator.js +54 -0
  145. package/dist/components/settings-list.d.ts +26 -0
  146. package/dist/components/settings-list.js +17 -0
  147. package/dist/components/sheet.d.ts +70 -0
  148. package/dist/components/sheet.js +77 -0
  149. package/dist/components/sidebar.d.ts +70 -0
  150. package/dist/components/sidebar.js +187 -0
  151. package/dist/components/skeleton.d.ts +31 -0
  152. package/dist/components/skeleton.js +32 -0
  153. package/dist/components/slider.d.ts +17 -0
  154. package/dist/components/slider.js +24 -0
  155. package/dist/components/spinner.d.ts +37 -0
  156. package/dist/components/spinner.js +43 -0
  157. package/dist/components/state-panel-samples.d.ts +25 -0
  158. package/dist/components/state-panel-samples.js +423 -0
  159. package/dist/components/state-panel.d.ts +35 -0
  160. package/dist/components/state-panel.js +29 -0
  161. package/dist/components/state-sample.d.ts +63 -0
  162. package/dist/components/state-sample.js +42 -0
  163. package/dist/components/switch.d.ts +12 -0
  164. package/dist/components/switch.js +14 -0
  165. package/dist/components/table-nuqs.d.ts +16 -0
  166. package/dist/components/table-nuqs.js +59 -0
  167. package/dist/components/table.d.ts +120 -0
  168. package/dist/components/table.js +663 -0
  169. package/dist/components/tabs.d.ts +37 -0
  170. package/dist/components/tabs.js +36 -0
  171. package/dist/components/textarea.d.ts +18 -0
  172. package/dist/components/textarea.js +19 -0
  173. package/dist/components/toast.d.ts +45 -0
  174. package/dist/components/toast.js +83 -0
  175. package/dist/components/toggle-group.d.ts +30 -0
  176. package/dist/components/toggle-group.js +39 -0
  177. package/dist/components/toggle.d.ts +27 -0
  178. package/dist/components/toggle.js +21 -0
  179. package/dist/components/tool-activity.d.ts +79 -0
  180. package/dist/components/tool-activity.js +226 -0
  181. package/dist/components/toolbar-status.d.ts +21 -0
  182. package/dist/components/toolbar-status.js +14 -0
  183. package/dist/components/tooltip.d.ts +31 -0
  184. package/dist/components/tooltip.js +99 -0
  185. package/dist/components/typed-text.d.ts +17 -0
  186. package/dist/components/typed-text.js +56 -0
  187. package/dist/index.d.ts +90 -0
  188. package/dist/index.js +90 -0
  189. package/dist/internal/brand-glyphs.d.ts +370 -0
  190. package/dist/internal/brand-glyphs.js +262 -0
  191. package/dist/internal/classes.d.ts +3 -0
  192. package/dist/internal/classes.js +20 -0
  193. package/dist/internal/code-tokens.d.ts +4 -0
  194. package/dist/internal/code-tokens.js +34 -0
  195. package/dist/internal/fieldset.d.ts +6 -0
  196. package/dist/internal/fieldset.js +38 -0
  197. package/dist/internal/file-kind.d.ts +4 -0
  198. package/dist/internal/file-kind.js +62 -0
  199. package/dist/internal/languages.d.ts +7 -0
  200. package/dist/internal/languages.js +1010 -0
  201. package/dist/internal/message-scroller.d.ts +102 -0
  202. package/dist/internal/message-scroller.js +637 -0
  203. package/dist/internal/pressable.d.ts +2 -0
  204. package/dist/internal/pressable.js +29 -0
  205. package/dist/internal/syntax.d.ts +14 -0
  206. package/dist/internal/syntax.js +137 -0
  207. package/dist/styles/accordion.css +102 -0
  208. package/dist/styles/alert-dialog.css +198 -0
  209. package/dist/styles/alert.css +149 -0
  210. package/dist/styles/aspect-ratio.css +8 -0
  211. package/dist/styles/attachment.css +700 -0
  212. package/dist/styles/avatar.css +186 -0
  213. package/dist/styles/badge.css +178 -0
  214. package/dist/styles/brand-icon.css +104 -0
  215. package/dist/styles/breadcrumb.css +121 -0
  216. package/dist/styles/button-group.css +113 -0
  217. package/dist/styles/button.css +380 -0
  218. package/dist/styles/calendar.css +295 -0
  219. package/dist/styles/canvas.css +313 -0
  220. package/dist/styles/card.css +146 -0
  221. package/dist/styles/carousel.css +107 -0
  222. package/dist/styles/chart.css +227 -0
  223. package/dist/styles/chat-confirmation.css +29 -0
  224. package/dist/styles/chat-input.css +240 -0
  225. package/dist/styles/chat-plan.css +109 -0
  226. package/dist/styles/chat-sources.css +191 -0
  227. package/dist/styles/checkbox.css +122 -0
  228. package/dist/styles/choice-list.css +343 -0
  229. package/dist/styles/code-block.css +211 -0
  230. package/dist/styles/collapsible.css +72 -0
  231. package/dist/styles/combobox.css +347 -0
  232. package/dist/styles/command.css +233 -0
  233. package/dist/styles/context-menu.css +151 -0
  234. package/dist/styles/dialog.css +237 -0
  235. package/dist/styles/dropdown-menu.css +150 -0
  236. package/dist/styles/field.css +340 -0
  237. package/dist/styles/file-explorer.css +517 -0
  238. package/dist/styles/file-viewer.css +375 -0
  239. package/dist/styles/form.css +155 -0
  240. package/dist/styles/glass-banner.css +308 -0
  241. package/dist/styles/gradient-banner.css +256 -0
  242. package/dist/styles/hover-card.css +95 -0
  243. package/dist/styles/index.css +268 -0
  244. package/dist/styles/input-group.css +285 -0
  245. package/dist/styles/input-otp.css +138 -0
  246. package/dist/styles/input.css +98 -0
  247. package/dist/styles/kbd.css +59 -0
  248. package/dist/styles/label.css +89 -0
  249. package/dist/styles/mention-list.css +166 -0
  250. package/dist/styles/menubar.css +226 -0
  251. package/dist/styles/message-actions.css +83 -0
  252. package/dist/styles/message-response.css +176 -0
  253. package/dist/styles/message-scroller.css +136 -0
  254. package/dist/styles/message.css +310 -0
  255. package/dist/styles/navigation-menu.css +291 -0
  256. package/dist/styles/notice-banner.css +68 -0
  257. package/dist/styles/page-content.css +21 -0
  258. package/dist/styles/page-header.css +156 -0
  259. package/dist/styles/pagination.css +72 -0
  260. package/dist/styles/plan-outline.css +393 -0
  261. package/dist/styles/popover.css +140 -0
  262. package/dist/styles/progress.css +93 -0
  263. package/dist/styles/prompt-list.css +165 -0
  264. package/dist/styles/questionnaire.css +308 -0
  265. package/dist/styles/radio-group.css +119 -0
  266. package/dist/styles/reasoning-effort.css +157 -0
  267. package/dist/styles/resizable.css +108 -0
  268. package/dist/styles/result-card.css +215 -0
  269. package/dist/styles/review-card.css +235 -0
  270. package/dist/styles/rich-text-editor.css +169 -0
  271. package/dist/styles/schema-diagram.css +419 -0
  272. package/dist/styles/scroll-area.css +77 -0
  273. package/dist/styles/search-dialog.css +280 -0
  274. package/dist/styles/search-field.css +17 -0
  275. package/dist/styles/select.css +285 -0
  276. package/dist/styles/selection-slot.css +31 -0
  277. package/dist/styles/separator.css +206 -0
  278. package/dist/styles/settings-list.css +81 -0
  279. package/dist/styles/sheet.css +361 -0
  280. package/dist/styles/sidebar.css +363 -0
  281. package/dist/styles/skeleton.css +80 -0
  282. package/dist/styles/slider.css +142 -0
  283. package/dist/styles/spinner.css +39 -0
  284. package/dist/styles/state-panel-samples.css +41 -0
  285. package/dist/styles/state-panel.css +173 -0
  286. package/dist/styles/state-sample.css +285 -0
  287. package/dist/styles/switch.css +128 -0
  288. package/dist/styles/table.css +604 -0
  289. package/dist/styles/tabs.css +223 -0
  290. package/dist/styles/textarea.css +77 -0
  291. package/dist/styles/themes/chatgpt.css +125 -0
  292. package/dist/styles/themes/claude.css +125 -0
  293. package/dist/styles/themes/cloudflare.css +125 -0
  294. package/dist/styles/themes/discord.css +125 -0
  295. package/dist/styles/themes/github.css +125 -0
  296. package/dist/styles/themes/grok.css +125 -0
  297. package/dist/styles/themes/linear.css +126 -0
  298. package/dist/styles/themes/neutral.css +125 -0
  299. package/dist/styles/themes/notion.css +125 -0
  300. package/dist/styles/themes/perplexity.css +125 -0
  301. package/dist/styles/themes/raycast.css +125 -0
  302. package/dist/styles/themes/spotify.css +125 -0
  303. package/dist/styles/themes/stripe.css +125 -0
  304. package/dist/styles/themes/supabase.css +125 -0
  305. package/dist/styles/themes/tulipfarm.css +115 -0
  306. package/dist/styles/themes/vercel.css +126 -0
  307. package/dist/styles/toast.css +197 -0
  308. package/dist/styles/toggle-group.css +161 -0
  309. package/dist/styles/toggle.css +119 -0
  310. package/dist/styles/tool-activity.css +396 -0
  311. package/dist/styles/toolbar-status.css +52 -0
  312. package/dist/styles/tooltip.css +122 -0
  313. package/dist/styles/typed-text.css +17 -0
  314. package/package.json +452 -4
@@ -0,0 +1,169 @@
1
+ @layer components {
2
+ .sprout-rich-text-editor {
3
+ box-sizing: border-box;
4
+ width: 100%;
5
+ min-width: 0;
6
+ color: var(--sprout-text);
7
+ }
8
+ .sprout-rich-text-editor-size-compact,
9
+ .sprout-rich-text-editor-condensed {
10
+ display: flex;
11
+ align-items: flex-end;
12
+ }
13
+ .sprout-rich-text-editor[data-disabled] {
14
+ cursor: not-allowed;
15
+ opacity: 0.6;
16
+ }
17
+
18
+ .sprout-rich-text-editor-body {
19
+ flex: 1;
20
+ min-width: 0;
21
+ /* Holds the editor's height before Tiptap mounts on the client. */
22
+ min-height: 5rem;
23
+ }
24
+ .sprout-rich-text-editor-size-compact > .sprout-rich-text-editor-body,
25
+ .sprout-rich-text-editor-condensed > .sprout-rich-text-editor-body {
26
+ min-height: 2.5rem;
27
+ }
28
+
29
+ .sprout-rich-text-editor-content {
30
+ box-sizing: border-box;
31
+ min-height: 5rem;
32
+ max-height: 16rem;
33
+ overflow-y: auto;
34
+ padding: 8px 12px;
35
+ border-radius: var(--sprout-radius-control);
36
+ color: var(--sprout-text);
37
+ font-family: inherit;
38
+ font-size: var(--sprout-text-base);
39
+ line-height: 1.5;
40
+ overflow-wrap: anywhere;
41
+ outline: 0 solid transparent;
42
+ outline-offset: 0;
43
+ }
44
+ .sprout-rich-text-editor-size-compact .sprout-rich-text-editor-content {
45
+ min-height: 2.5rem;
46
+ max-height: 8rem;
47
+ font-size: var(--sprout-text-sm);
48
+ line-height: 20px;
49
+ }
50
+ .sprout-rich-text-editor-condensed .sprout-rich-text-editor-content {
51
+ min-height: 2.5rem;
52
+ max-height: 8rem;
53
+ }
54
+ .sprout-rich-text-editor-content:focus-visible {
55
+ outline: 0 solid transparent;
56
+ }
57
+ /* Inside an input group, the group draws the focus ring for the editor. */
58
+ .sprout-input-group .sprout-rich-text-editor-content:focus-visible {
59
+ outline: 0 solid transparent;
60
+ }
61
+ .sprout-rich-text-editor[data-disabled] .sprout-rich-text-editor-content {
62
+ cursor: not-allowed;
63
+ }
64
+
65
+ .sprout-rich-text-editor-content .is-editor-empty:first-child::before {
66
+ content: attr(data-placeholder);
67
+ float: left;
68
+ height: 0;
69
+ color: var(--sprout-muted);
70
+ pointer-events: none;
71
+ }
72
+
73
+ .sprout-rich-text-editor-content
74
+ :where(p, h1, h2, h3, blockquote, pre, ul, ol) {
75
+ margin: 0;
76
+ }
77
+ .sprout-rich-text-editor-content :where(h1, h2, h3) {
78
+ font-weight: 600;
79
+ line-height: 1.4;
80
+ }
81
+ .sprout-rich-text-editor-content h1 {
82
+ font-size: 1.25rem;
83
+ }
84
+ .sprout-rich-text-editor-content h2 {
85
+ font-size: 1.125rem;
86
+ }
87
+ .sprout-rich-text-editor-content h3 {
88
+ font-size: 1rem;
89
+ }
90
+ .sprout-rich-text-editor-content :where(ul, ol) {
91
+ padding-left: 24px;
92
+ }
93
+ .sprout-rich-text-editor-content ul {
94
+ list-style: disc;
95
+ }
96
+ .sprout-rich-text-editor-content ol {
97
+ list-style: decimal;
98
+ }
99
+ .sprout-rich-text-editor-content li > p {
100
+ margin: 0;
101
+ }
102
+ .sprout-rich-text-editor-content blockquote {
103
+ padding-left: 12px;
104
+ border-left: 2px solid var(--sprout-line);
105
+ color: var(--sprout-muted);
106
+ }
107
+ .sprout-rich-text-editor-content code {
108
+ padding: 0 4px;
109
+ border-radius: 4px;
110
+ background-color: var(--sprout-hover);
111
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
112
+ font-size: 0.875em;
113
+ }
114
+ .sprout-rich-text-editor-content pre {
115
+ overflow-x: auto;
116
+ padding: 12px;
117
+ border-radius: var(--sprout-radius-control);
118
+ background-color: var(--sprout-hover);
119
+ }
120
+ .sprout-rich-text-editor-content pre code {
121
+ padding: 0;
122
+ background-color: transparent;
123
+ white-space: pre;
124
+ }
125
+ .sprout-rich-text-editor-content a {
126
+ color: var(--sprout-primary);
127
+ text-decoration: underline;
128
+ text-underline-offset: 2px;
129
+ }
130
+
131
+ .sprout-rich-text-editor-toolbar {
132
+ box-sizing: border-box;
133
+ display: flex;
134
+ flex-wrap: wrap;
135
+ align-items: center;
136
+ gap: 4px;
137
+ min-height: 32px;
138
+ padding: 4px 8px;
139
+ border-top: 1px solid var(--sprout-line);
140
+ }
141
+ .sprout-rich-text-editor-toolbar-inline {
142
+ flex-shrink: 0;
143
+ flex-wrap: nowrap;
144
+ min-height: 0;
145
+ padding: 4px;
146
+ border-top: 0;
147
+ }
148
+
149
+ @media (prefers-reduced-motion: no-preference) {
150
+ .sprout-rich-text-editor {
151
+ transition: opacity var(--sprout-motion-fast, 120ms) ease-out;
152
+ }
153
+ .sprout-rich-text-editor-content {
154
+ transition: outline-color var(--sprout-motion-fast, 120ms) ease-out;
155
+ }
156
+ }
157
+
158
+ @media (forced-colors: active) {
159
+ .sprout-rich-text-editor-content:focus-visible {
160
+ outline-color: Highlight;
161
+ }
162
+ .sprout-rich-text-editor-toolbar {
163
+ border-top-color: CanvasText;
164
+ }
165
+ .sprout-rich-text-editor-toolbar-inline {
166
+ border-top: 0;
167
+ }
168
+ }
169
+ }
@@ -0,0 +1,419 @@
1
+ @layer components {
2
+ .sprout-schema-diagram {
3
+ position: relative;
4
+ display: flex;
5
+ flex: 1 1 0%;
6
+ box-sizing: border-box;
7
+ width: 100%;
8
+ height: 100%;
9
+ min-width: 0;
10
+ min-height: 24rem;
11
+ overflow: hidden;
12
+ border: 1px solid var(--sprout-line);
13
+ border-radius: var(--sprout-radius-panel);
14
+ background: var(--sprout-canvas);
15
+ color: var(--sprout-text);
16
+ font-family: var(--sprout-font);
17
+ }
18
+
19
+ /* React Flow adds a .light or .dark class to its root. Inherit the page's
20
+ tokens there so the diagram follows Sprout's mode and brand theme. */
21
+ .sprout-schema-flow.light,
22
+ .sprout-schema-flow.dark {
23
+ --sprout-canvas: inherit;
24
+ --sprout-surface: inherit;
25
+ --sprout-hover: inherit;
26
+ --sprout-active: inherit;
27
+ --sprout-text: inherit;
28
+ --sprout-muted: inherit;
29
+ --sprout-line: inherit;
30
+ --sprout-border: inherit;
31
+ --sprout-border-strong: inherit;
32
+ --sprout-input: inherit;
33
+ --sprout-primary: inherit;
34
+ --sprout-primary-hover: inherit;
35
+ --sprout-primary-active: inherit;
36
+ --sprout-primary-subtle: inherit;
37
+ --sprout-on-primary: inherit;
38
+ --sprout-focus: inherit;
39
+ --sprout-danger: inherit;
40
+ --sprout-danger-hover: inherit;
41
+ --sprout-danger-subtle: inherit;
42
+ --sprout-on-danger: inherit;
43
+ --sprout-info: inherit;
44
+ --sprout-info-subtle: inherit;
45
+ --sprout-secondary: inherit;
46
+ --sprout-success: inherit;
47
+ --sprout-success-subtle: inherit;
48
+ --sprout-warning: inherit;
49
+ --sprout-warning-subtle: inherit;
50
+ --sprout-overlay: inherit;
51
+ }
52
+
53
+ /* The structural rules React Flow needs, scoped to the diagram. */
54
+ .sprout-schema-flow {
55
+ position: relative;
56
+ direction: ltr;
57
+ flex: 1 1 0%;
58
+ width: 100%;
59
+ height: 100%;
60
+ min-height: 24rem;
61
+ overflow: hidden;
62
+ outline: none;
63
+ background: transparent;
64
+ }
65
+ .sprout-schema-flow:focus-visible {
66
+ outline: var(--sprout-focus-width) solid var(--sprout-focus-ring);
67
+ outline-offset: -1px;
68
+ border-radius: inherit;
69
+ }
70
+ .sprout-schema-flow .react-flow__container {
71
+ position: absolute;
72
+ top: 0;
73
+ left: 0;
74
+ width: 100%;
75
+ height: 100%;
76
+ }
77
+ .sprout-schema-flow .react-flow__pane {
78
+ z-index: 1;
79
+ touch-action: none;
80
+ }
81
+ .sprout-schema-flow .react-flow__pane.draggable {
82
+ cursor: grab;
83
+ }
84
+ .sprout-schema-flow .react-flow__pane.dragging {
85
+ cursor: grabbing;
86
+ }
87
+ .sprout-schema-flow .react-flow__viewport {
88
+ z-index: 2;
89
+ transform-origin: 0 0;
90
+ pointer-events: none;
91
+ }
92
+ .sprout-schema-flow .react-flow__renderer {
93
+ z-index: 4;
94
+ }
95
+ .sprout-schema-flow .react-flow__background {
96
+ z-index: -1;
97
+ pointer-events: none;
98
+ }
99
+ .sprout-schema-flow .react-flow__background-pattern.dots {
100
+ fill: var(--sprout-line);
101
+ }
102
+ .sprout-schema-flow .react-flow__edges {
103
+ position: absolute;
104
+ }
105
+ .sprout-schema-flow .react-flow__edges svg {
106
+ position: absolute;
107
+ overflow: visible;
108
+ pointer-events: none;
109
+ }
110
+ .sprout-schema-flow .react-flow__edge-path {
111
+ fill: none;
112
+ stroke: var(--sprout-muted);
113
+ stroke-width: 1.25;
114
+ }
115
+ .sprout-schema-flow .react-flow__edgelabel-renderer,
116
+ .sprout-schema-flow .react-flow__viewport-portal {
117
+ position: absolute;
118
+ top: 0;
119
+ left: 0;
120
+ width: 100%;
121
+ height: 100%;
122
+ pointer-events: none;
123
+ user-select: none;
124
+ }
125
+ .sprout-schema-flow .react-flow__nodes {
126
+ transform-origin: 0 0;
127
+ pointer-events: none;
128
+ }
129
+ .sprout-schema-flow .react-flow__node {
130
+ position: absolute;
131
+ box-sizing: border-box;
132
+ transform-origin: 0 0;
133
+ border-radius: 8px;
134
+ outline: none;
135
+ user-select: none;
136
+ pointer-events: all;
137
+ cursor: default;
138
+ }
139
+ .sprout-schema-flow .react-flow__node.draggable {
140
+ cursor: grab;
141
+ }
142
+ .sprout-schema-flow .react-flow__node.dragging {
143
+ cursor: grabbing;
144
+ }
145
+ .sprout-schema-flow .react-flow__node:focus-visible {
146
+ outline: var(--sprout-focus-width) solid var(--sprout-focus-ring);
147
+ outline-offset: 0;
148
+ }
149
+ .sprout-schema-flow .react-flow__panel {
150
+ position: absolute;
151
+ z-index: 5;
152
+ margin: 12px;
153
+ }
154
+ .sprout-schema-flow .react-flow__panel.top {
155
+ top: 0;
156
+ }
157
+ .sprout-schema-flow .react-flow__panel.bottom {
158
+ bottom: 0;
159
+ }
160
+ .sprout-schema-flow .react-flow__panel.right {
161
+ right: 0;
162
+ }
163
+ .sprout-schema-flow .react-flow__panel.left {
164
+ left: 0;
165
+ }
166
+
167
+ .sprout-schema-handle.react-flow__handle {
168
+ position: absolute;
169
+ width: 6px;
170
+ height: 6px;
171
+ min-width: 0;
172
+ min-height: 0;
173
+ border: 0;
174
+ opacity: 0;
175
+ pointer-events: none;
176
+ }
177
+ .sprout-schema-handle.react-flow__handle-left {
178
+ top: 50%;
179
+ left: 0;
180
+ transform: translate(-50%, -50%);
181
+ }
182
+ .sprout-schema-handle.react-flow__handle-right {
183
+ top: 50%;
184
+ right: 0;
185
+ transform: translate(50%, -50%);
186
+ }
187
+ .sprout-schema-handle.react-flow__handle-top {
188
+ top: 0;
189
+ left: 50%;
190
+ transform: translate(-50%, -50%);
191
+ }
192
+ .sprout-schema-handle.react-flow__handle-bottom {
193
+ bottom: 0;
194
+ left: 50%;
195
+ transform: translate(-50%, 50%);
196
+ }
197
+ /* Links land on the middle of the target table's header. */
198
+ .sprout-schema-handle-target.react-flow__handle-left {
199
+ top: 22px;
200
+ }
201
+
202
+ .sprout-schema-table {
203
+ box-sizing: border-box;
204
+ width: 264px;
205
+ overflow: hidden;
206
+ border: 1px solid var(--sprout-line);
207
+ border-top-width: 2px;
208
+ border-radius: 8px;
209
+ background: var(--sprout-surface);
210
+ color: var(--sprout-text);
211
+ box-shadow: var(--sprout-shadow-control);
212
+ }
213
+ .sprout-schema-table[data-state="new"] {
214
+ border-top-color: var(--sprout-success);
215
+ }
216
+ .sprout-schema-table[data-state="changed"] {
217
+ border-top-color: var(--sprout-warning);
218
+ }
219
+ .sprout-schema-table[data-state="linked"] {
220
+ border-style: dashed;
221
+ border-top-color: var(--sprout-line);
222
+ }
223
+ .react-flow__node.dragging .sprout-schema-table {
224
+ box-shadow: var(--sprout-shadow-panel);
225
+ }
226
+
227
+ .sprout-schema-table-header {
228
+ display: flex;
229
+ align-items: center;
230
+ gap: 8px;
231
+ box-sizing: border-box;
232
+ height: 44px;
233
+ padding: 0 12px;
234
+ border-bottom: 1px solid var(--sprout-line);
235
+ background: color-mix(
236
+ in oklab,
237
+ var(--sprout-hover) 45%,
238
+ var(--sprout-surface)
239
+ );
240
+ }
241
+ .sprout-schema-table-title {
242
+ flex: 1;
243
+ min-width: 0;
244
+ margin: 0;
245
+ overflow: hidden;
246
+ color: var(--sprout-text);
247
+ font-size: var(--sprout-text-sm);
248
+ font-weight: 500;
249
+ line-height: 1.25rem;
250
+ text-overflow: ellipsis;
251
+ white-space: nowrap;
252
+ }
253
+ .sprout-schema-table-empty {
254
+ margin: 0;
255
+ padding: 8px 12px;
256
+ color: var(--sprout-muted);
257
+ font-size: var(--sprout-text-xs);
258
+ line-height: 1rem;
259
+ }
260
+
261
+ .sprout-schema-fields {
262
+ margin: 0;
263
+ padding: 0;
264
+ list-style: none;
265
+ }
266
+ .sprout-schema-field {
267
+ position: relative;
268
+ padding: 6px 12px;
269
+ border-bottom: 1px solid var(--sprout-line);
270
+ }
271
+ .sprout-schema-field:last-child {
272
+ border-bottom: 0;
273
+ }
274
+ .sprout-schema-field[data-change="added"] {
275
+ background: var(--sprout-success-subtle);
276
+ }
277
+ .sprout-schema-field[data-change="changed"] {
278
+ background: var(--sprout-warning-subtle);
279
+ }
280
+ .sprout-schema-field[data-change="removed"] {
281
+ background: var(--sprout-danger-subtle);
282
+ }
283
+ .sprout-schema-field-line {
284
+ display: flex;
285
+ align-items: center;
286
+ gap: 8px;
287
+ height: 20px;
288
+ font-size: 0.8125rem;
289
+ line-height: 1.25rem;
290
+ }
291
+ .sprout-schema-field[data-change="removed"] .sprout-schema-field-line {
292
+ text-decoration: line-through;
293
+ }
294
+ .sprout-schema-field-key {
295
+ display: flex;
296
+ flex-shrink: 0;
297
+ justify-content: center;
298
+ width: 12px;
299
+ color: var(--sprout-muted);
300
+ }
301
+ .sprout-schema-field-name {
302
+ flex: 1;
303
+ min-width: 0;
304
+ overflow: hidden;
305
+ color: var(--sprout-text);
306
+ text-overflow: ellipsis;
307
+ white-space: nowrap;
308
+ }
309
+ .sprout-schema-field-required {
310
+ color: var(--sprout-muted);
311
+ }
312
+ .sprout-schema-field-type {
313
+ flex-shrink: 0;
314
+ max-width: 45%;
315
+ overflow: hidden;
316
+ color: var(--sprout-muted);
317
+ font-size: var(--sprout-text-xs);
318
+ text-overflow: ellipsis;
319
+ white-space: nowrap;
320
+ }
321
+ .sprout-schema-field-detail {
322
+ margin: 0;
323
+ padding-left: 20px;
324
+ overflow: hidden;
325
+ color: var(--sprout-muted);
326
+ font-size: var(--sprout-text-xs);
327
+ line-height: 1rem;
328
+ text-overflow: ellipsis;
329
+ white-space: nowrap;
330
+ }
331
+
332
+ .sprout-schema-link-label {
333
+ position: absolute;
334
+ box-sizing: border-box;
335
+ max-width: 180px;
336
+ overflow: hidden;
337
+ padding: 0 6px;
338
+ border: 1px solid var(--sprout-line);
339
+ border-radius: 6px;
340
+ background: var(--sprout-surface);
341
+ color: var(--sprout-muted);
342
+ font-family: var(--sprout-font);
343
+ font-size: 0.6875rem;
344
+ line-height: 1rem;
345
+ text-overflow: ellipsis;
346
+ white-space: nowrap;
347
+ pointer-events: none;
348
+ }
349
+
350
+ .sprout-schema-controls {
351
+ display: flex;
352
+ flex-direction: column;
353
+ gap: 2px;
354
+ padding: 2px;
355
+ border: 1px solid var(--sprout-line);
356
+ border-radius: 8px;
357
+ background: var(--sprout-surface);
358
+ box-shadow: var(--sprout-shadow-control);
359
+ }
360
+
361
+ .sprout-schema-legend {
362
+ display: flex;
363
+ flex-wrap: wrap;
364
+ align-items: center;
365
+ gap: 4px 16px;
366
+ margin: 0;
367
+ padding: 0;
368
+ color: var(--sprout-muted);
369
+ font-family: var(--sprout-font);
370
+ font-size: var(--sprout-text-xs);
371
+ line-height: 1rem;
372
+ list-style: none;
373
+ }
374
+ .sprout-schema-legend-item {
375
+ display: flex;
376
+ align-items: center;
377
+ gap: 6px;
378
+ }
379
+ .sprout-schema-legend-swatch {
380
+ flex-shrink: 0;
381
+ width: 10px;
382
+ height: 10px;
383
+ border-radius: 2px;
384
+ }
385
+ .sprout-schema-legend-swatch[data-change="added"] {
386
+ background: var(--sprout-success-subtle);
387
+ box-shadow: 0 0 0 1px var(--sprout-success);
388
+ }
389
+ .sprout-schema-legend-swatch[data-change="changed"] {
390
+ background: var(--sprout-warning-subtle);
391
+ box-shadow: 0 0 0 1px var(--sprout-warning);
392
+ }
393
+ .sprout-schema-legend-swatch[data-change="removed"] {
394
+ background: var(--sprout-danger-subtle);
395
+ box-shadow: 0 0 0 1px var(--sprout-danger);
396
+ }
397
+
398
+ .sprout-schema-sr-only {
399
+ position: absolute;
400
+ width: 1px;
401
+ height: 1px;
402
+ margin: -1px;
403
+ padding: 0;
404
+ overflow: hidden;
405
+ clip-path: inset(50%);
406
+ white-space: nowrap;
407
+ border: 0;
408
+ }
409
+
410
+ @media (prefers-reduced-motion: no-preference) {
411
+ .sprout-schema-table {
412
+ transition: box-shadow var(--sprout-motion-normal)
413
+ var(--sprout-motion-ease);
414
+ }
415
+ .sprout-schema-flow .react-flow__node {
416
+ transition: outline-color var(--sprout-motion-fast) ease-out;
417
+ }
418
+ }
419
+ }
@@ -0,0 +1,77 @@
1
+ @layer components {
2
+ .sprout-scroll-area {
3
+ position: relative;
4
+ min-width: 0;
5
+ }
6
+ .sprout-scroll-area[data-size="sm"] {
7
+ height: 10rem;
8
+ }
9
+ .sprout-scroll-area[data-size="md"] {
10
+ height: 16rem;
11
+ }
12
+ .sprout-scroll-area[data-variant="table"] {
13
+ width: 100%;
14
+ border: 1px solid var(--sprout-input);
15
+ border-radius: calc(var(--sprout-radius-control) + 2px);
16
+ background: var(--sprout-surface);
17
+ }
18
+
19
+ .sprout-scroll-area-viewport {
20
+ width: 100%;
21
+ height: 100%;
22
+ border-radius: inherit;
23
+ overscroll-behavior: contain;
24
+ }
25
+ .sprout-scroll-area-viewport:focus-visible {
26
+ outline: var(--sprout-focus-width) solid var(--sprout-focus-ring);
27
+ outline-offset: -1px;
28
+ }
29
+ .sprout-scroll-area[data-variant="table"] > .sprout-scroll-area-viewport {
30
+ max-height: 60dvh;
31
+ }
32
+
33
+ .sprout-scroll-area-scrollbar {
34
+ z-index: 30;
35
+ display: flex;
36
+ padding: 1px;
37
+ touch-action: none;
38
+ user-select: none;
39
+ }
40
+ .sprout-scroll-area-scrollbar[data-orientation="vertical"] {
41
+ width: 10px;
42
+ height: 100%;
43
+ border-left: 1px solid transparent;
44
+ }
45
+ .sprout-scroll-area-scrollbar[data-orientation="horizontal"] {
46
+ height: 10px;
47
+ flex-direction: column;
48
+ border-top: 1px solid transparent;
49
+ }
50
+
51
+ .sprout-scroll-area-thumb {
52
+ position: relative;
53
+ flex: 1 1 0;
54
+ border-radius: 9999px;
55
+ background: color-mix(in oklab, var(--sprout-muted) 40%, transparent);
56
+ }
57
+ .sprout-scroll-area-thumb:hover,
58
+ .sprout-scroll-area-scrollbar[data-scrolling] > .sprout-scroll-area-thumb,
59
+ .sprout-scroll-area-thumb:active {
60
+ background: color-mix(in oklab, var(--sprout-muted) 60%, transparent);
61
+ }
62
+
63
+ .sprout-scroll-area-corner {
64
+ background: transparent;
65
+ }
66
+
67
+ @media (prefers-reduced-motion: no-preference) {
68
+ .sprout-scroll-area-viewport {
69
+ transition: outline-color var(--sprout-motion-fast)
70
+ var(--sprout-motion-ease);
71
+ }
72
+ .sprout-scroll-area-thumb {
73
+ transition: background-color var(--sprout-motion-fast)
74
+ var(--sprout-motion-ease);
75
+ }
76
+ }
77
+ }