@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,165 @@
1
+ @layer components {
2
+ .sprout-prompt-list {
3
+ width: 100%;
4
+ min-width: 0;
5
+ font-family: var(--sprout-font);
6
+ color: var(--sprout-text);
7
+ }
8
+ .sprout-prompt-list-title {
9
+ margin: 0;
10
+ padding: 0 12px 6px;
11
+ font-size: var(--sprout-text-xs);
12
+ font-weight: 500;
13
+ line-height: 1rem;
14
+ color: var(--sprout-muted);
15
+ }
16
+ .sprout-prompt-list-items {
17
+ display: flex;
18
+ flex-direction: column;
19
+ margin: 0;
20
+ padding: 0;
21
+ list-style: none;
22
+ }
23
+
24
+ .sprout-prompt-list-item {
25
+ --sprout-brand-ring: var(--sprout-canvas);
26
+ position: relative;
27
+ display: flex;
28
+ align-items: center;
29
+ gap: 12px;
30
+ min-width: 0;
31
+ min-height: 32px;
32
+ padding: 0 12px;
33
+ border-radius: var(--sprout-radius-panel);
34
+ font-size: var(--sprout-text-sm);
35
+ line-height: 1.25rem;
36
+ outline: 0 solid transparent;
37
+ outline-offset: 0;
38
+ }
39
+ @media (pointer: coarse) {
40
+ .sprout-prompt-list-item {
41
+ min-height: 44px;
42
+ }
43
+ }
44
+ @media (hover: hover) {
45
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):hover {
46
+ --sprout-brand-ring: var(--sprout-hover);
47
+ background: var(--sprout-hover);
48
+ }
49
+ }
50
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:focus-visible) {
51
+ --sprout-brand-ring: var(--sprout-hover);
52
+ background: var(--sprout-hover);
53
+ outline: var(--sprout-focus-width) solid var(--sprout-focus-ring);
54
+ }
55
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:disabled) {
56
+ opacity: 0.5;
57
+ }
58
+
59
+ .sprout-prompt-list-icon {
60
+ display: grid;
61
+ flex-shrink: 0;
62
+ place-items: center;
63
+ width: 20px;
64
+ height: 20px;
65
+ color: color-mix(in oklab, var(--sprout-text) 72%, var(--sprout-muted));
66
+ }
67
+ .sprout-prompt-list-icon svg {
68
+ width: 16px;
69
+ height: 16px;
70
+ }
71
+
72
+ /* The button's ::after covers the row, so the whole row is the target. */
73
+ .sprout-prompt-list-button {
74
+ min-width: 0;
75
+ margin: 0;
76
+ padding: 0;
77
+ border: 0;
78
+ background: transparent;
79
+ font: inherit;
80
+ color: inherit;
81
+ text-align: start;
82
+ white-space: nowrap;
83
+ overflow: hidden;
84
+ text-overflow: ellipsis;
85
+ cursor: pointer;
86
+ outline: none;
87
+ -webkit-tap-highlight-color: transparent;
88
+ }
89
+ .sprout-prompt-list-button::after {
90
+ content: "";
91
+ position: absolute;
92
+ inset: 0;
93
+ border-radius: inherit;
94
+ }
95
+ .sprout-prompt-list-button:disabled {
96
+ cursor: not-allowed;
97
+ }
98
+
99
+ /* Brand tiles sit above the row target so their tooltips open on hover. */
100
+ .sprout-prompt-list-brands {
101
+ position: relative;
102
+ z-index: 1;
103
+ }
104
+
105
+ .sprout-prompt-list-arrow {
106
+ flex-shrink: 0;
107
+ width: 14px;
108
+ height: 14px;
109
+ margin-inline-start: auto;
110
+ color: var(--sprout-muted);
111
+ }
112
+ .sprout-prompt-list-item:dir(rtl) .sprout-prompt-list-arrow {
113
+ transform: scaleX(-1);
114
+ }
115
+
116
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(
117
+ :hover,
118
+ :focus-within
119
+ )
120
+ :is(.sprout-prompt-list-icon, .sprout-prompt-list-arrow) {
121
+ color: var(--sprout-text);
122
+ }
123
+
124
+ @media (prefers-reduced-motion: no-preference) {
125
+ .sprout-prompt-list-item {
126
+ animation: sprout-prompt-rise var(--sprout-motion-normal)
127
+ var(--sprout-motion-ease) both;
128
+ animation-delay: calc(var(--sprout-prompt-index, 0) * 40ms);
129
+ transition: background-color var(--sprout-motion-fast)
130
+ var(--sprout-motion-ease);
131
+ }
132
+ .sprout-prompt-list-icon,
133
+ .sprout-prompt-list-arrow {
134
+ transition:
135
+ transform var(--sprout-motion-fast) var(--sprout-motion-ease),
136
+ color var(--sprout-motion-fast) var(--sprout-motion-ease);
137
+ }
138
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(
139
+ :hover,
140
+ :focus-within
141
+ )
142
+ .sprout-prompt-list-icon {
143
+ transform: scale(1.08);
144
+ }
145
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(
146
+ :hover,
147
+ :focus-within
148
+ )
149
+ .sprout-prompt-list-arrow:not(:dir(rtl)) {
150
+ transform: translateX(2px);
151
+ }
152
+ }
153
+ @keyframes sprout-prompt-rise {
154
+ from {
155
+ opacity: 0;
156
+ transform: translateY(4px);
157
+ }
158
+ }
159
+
160
+ @media (forced-colors: active) {
161
+ .sprout-prompt-list-item:has(.sprout-prompt-list-button:focus-visible) {
162
+ outline-color: Highlight;
163
+ }
164
+ }
165
+ }
@@ -0,0 +1,308 @@
1
+ @layer components {
2
+ .sprout-questionnaire {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 16px;
6
+ width: 100%;
7
+ min-width: 0;
8
+ margin: 0;
9
+ font-family: inherit;
10
+ color: var(--sprout-text);
11
+ }
12
+
13
+ .sprout-questionnaire-progress {
14
+ width: fit-content;
15
+ min-width: 14ch;
16
+ min-height: 1rem;
17
+ font-size: var(--sprout-text-xs);
18
+ font-weight: 500;
19
+ line-height: 1rem;
20
+ font-variant-numeric: tabular-nums;
21
+ color: var(--sprout-muted);
22
+ }
23
+
24
+ .sprout-questionnaire-item {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 16px;
28
+ min-width: 0;
29
+ margin: 0;
30
+ padding: 0;
31
+ border: 0;
32
+ outline: none;
33
+ }
34
+ .sprout-questionnaire-item[hidden] {
35
+ display: none;
36
+ }
37
+
38
+ /* A rendered legend sits outside the flex flow, so it carries its own gap. */
39
+ .sprout-questionnaire-title {
40
+ margin: 0 0 16px;
41
+ padding: 0;
42
+ font-size: var(--sprout-text-base);
43
+ font-weight: 500;
44
+ line-height: 1.375;
45
+ text-wrap: pretty;
46
+ overflow-wrap: anywhere;
47
+ color: var(--sprout-text);
48
+ }
49
+ .sprout-questionnaire-title:has(~ .sprout-questionnaire-description) {
50
+ margin-bottom: 4px;
51
+ }
52
+
53
+ .sprout-questionnaire-description {
54
+ margin: 0;
55
+ font-size: var(--sprout-text-sm);
56
+ line-height: 1.25rem;
57
+ text-wrap: pretty;
58
+ color: var(--sprout-muted);
59
+ }
60
+
61
+ .sprout-questionnaire-choices {
62
+ display: grid;
63
+ gap: 8px;
64
+ min-width: 0;
65
+ }
66
+
67
+ .sprout-questionnaire-choice {
68
+ position: relative;
69
+ display: flex;
70
+ align-items: flex-start;
71
+ gap: 10px;
72
+ box-sizing: border-box;
73
+ min-width: 0;
74
+ min-height: 44px;
75
+ padding: 11px 12px;
76
+ border: 1px solid var(--sprout-input);
77
+ border-radius: var(--sprout-radius-panel);
78
+ background: transparent;
79
+ font-size: var(--sprout-text-sm);
80
+ line-height: 1.25rem;
81
+ text-align: start;
82
+ cursor: pointer;
83
+ user-select: none;
84
+ outline: 0 solid transparent;
85
+ outline-offset: 0;
86
+ -webkit-tap-highlight-color: transparent;
87
+ }
88
+ @media (hover: hover) {
89
+ .sprout-questionnaire-choice:not([data-disabled]):hover {
90
+ background: color-mix(in oklab, var(--sprout-hover) 60%, transparent);
91
+ }
92
+ }
93
+ .sprout-questionnaire-choice:has(
94
+ > .sprout-questionnaire-choice-input:focus-visible
95
+ ) {
96
+ outline: var(--sprout-focus-width) solid var(--sprout-focus-ring);
97
+ }
98
+ .sprout-questionnaire-choice[data-checked] {
99
+ border-color: var(--sprout-focus);
100
+ background: var(--sprout-primary-subtle);
101
+ }
102
+ .sprout-questionnaire-choice[data-invalid] {
103
+ border-color: var(--sprout-danger);
104
+ }
105
+ .sprout-questionnaire-choice[data-invalid]:has(
106
+ > .sprout-questionnaire-choice-input:focus-visible
107
+ ) {
108
+ outline-color: var(--sprout-danger);
109
+ }
110
+ .sprout-questionnaire-choice[data-disabled] {
111
+ cursor: not-allowed;
112
+ opacity: 0.5;
113
+ }
114
+
115
+ /* The real input covers the row so any click or tap reaches it. */
116
+ .sprout-questionnaire-choice-input {
117
+ position: absolute;
118
+ inset: -1px;
119
+ z-index: 1;
120
+ width: calc(100% + 2px);
121
+ height: calc(100% + 2px);
122
+ margin: 0;
123
+ opacity: 0;
124
+ cursor: inherit;
125
+ }
126
+
127
+ .sprout-questionnaire-choice-indicator {
128
+ position: relative;
129
+ display: flex;
130
+ flex-shrink: 0;
131
+ align-items: center;
132
+ justify-content: center;
133
+ box-sizing: border-box;
134
+ width: 16px;
135
+ height: 16px;
136
+ margin-top: 2px;
137
+ border: 1px solid var(--sprout-border);
138
+ border-radius: 4px;
139
+ background: var(--sprout-surface);
140
+ color: var(--sprout-on-primary);
141
+ pointer-events: none;
142
+ }
143
+ .sprout-questionnaire-choice[data-type="radio"]
144
+ .sprout-questionnaire-choice-indicator {
145
+ border-radius: 999px;
146
+ }
147
+ .sprout-questionnaire-choice[data-checked]
148
+ .sprout-questionnaire-choice-indicator {
149
+ border-color: var(--sprout-primary);
150
+ background: var(--sprout-primary);
151
+ }
152
+ .sprout-questionnaire-choice-dot,
153
+ .sprout-questionnaire-choice-check {
154
+ display: none;
155
+ }
156
+ .sprout-questionnaire-choice-dot {
157
+ width: 6px;
158
+ height: 6px;
159
+ border-radius: 999px;
160
+ background: var(--sprout-on-primary);
161
+ }
162
+ .sprout-questionnaire-choice-check {
163
+ width: 12px;
164
+ height: 12px;
165
+ }
166
+ .sprout-questionnaire-choice[data-type="radio"][data-checked]
167
+ .sprout-questionnaire-choice-dot,
168
+ .sprout-questionnaire-choice[data-type="checkbox"][data-checked]
169
+ .sprout-questionnaire-choice-check {
170
+ display: block;
171
+ }
172
+
173
+ .sprout-questionnaire-choice-label {
174
+ display: flex;
175
+ flex: 1;
176
+ flex-direction: column;
177
+ gap: 2px;
178
+ min-width: 0;
179
+ overflow-wrap: anywhere;
180
+ }
181
+ .sprout-questionnaire-choice-description {
182
+ color: var(--sprout-muted);
183
+ }
184
+
185
+ .sprout-questionnaire-choice-shortcut {
186
+ margin-inline-start: auto;
187
+ font-variant-numeric: tabular-nums;
188
+ pointer-events: none;
189
+ }
190
+ .sprout-questionnaire-choice[data-checked]
191
+ .sprout-questionnaire-choice-shortcut {
192
+ border-color: color-mix(
193
+ in oklab,
194
+ var(--sprout-focus) 40%,
195
+ var(--sprout-line)
196
+ );
197
+ color: var(--sprout-text);
198
+ }
199
+
200
+ .sprout-questionnaire-input-wrapper {
201
+ position: relative;
202
+ width: 100%;
203
+ min-width: 0;
204
+ }
205
+
206
+ .sprout-questionnaire-error {
207
+ margin: 0;
208
+ font-size: var(--sprout-text-sm);
209
+ line-height: 1.25rem;
210
+ color: var(--sprout-danger);
211
+ }
212
+ .sprout-questionnaire-error[hidden] {
213
+ display: none;
214
+ }
215
+
216
+ .sprout-questionnaire-actions {
217
+ display: grid;
218
+ grid-template-columns: minmax(0, 1fr) auto auto;
219
+ align-items: center;
220
+ gap: 8px;
221
+ width: 100%;
222
+ min-height: 28px;
223
+ }
224
+ .sprout-questionnaire-actions .sprout-questionnaire-action[hidden] {
225
+ display: none;
226
+ }
227
+ .sprout-questionnaire-previous {
228
+ grid-row: 1;
229
+ grid-column: 1;
230
+ justify-self: start;
231
+ }
232
+ .sprout-questionnaire-skip {
233
+ grid-row: 1;
234
+ grid-column: 2;
235
+ justify-self: end;
236
+ }
237
+ .sprout-questionnaire-next,
238
+ .sprout-questionnaire-submit {
239
+ grid-row: 1;
240
+ grid-column: 3;
241
+ justify-self: end;
242
+ }
243
+
244
+ /* Phones get 44px targets. */
245
+ @media (max-width: 639.98px) {
246
+ .sprout-questionnaire-actions {
247
+ min-height: 44px;
248
+ }
249
+ .sprout-questionnaire-action,
250
+ .sprout-questionnaire-input {
251
+ min-height: 44px;
252
+ }
253
+ .sprout-questionnaire-input {
254
+ font-size: var(--sprout-text-base);
255
+ }
256
+ }
257
+
258
+ @media (prefers-reduced-motion: no-preference) {
259
+ .sprout-questionnaire-choice,
260
+ .sprout-questionnaire-choice-indicator,
261
+ .sprout-questionnaire-choice-shortcut {
262
+ transition:
263
+ background-color var(--sprout-motion-fast, 120ms)
264
+ var(--sprout-motion-ease, ease-out),
265
+ border-color var(--sprout-motion-fast, 120ms)
266
+ var(--sprout-motion-ease, ease-out),
267
+ color var(--sprout-motion-fast, 120ms)
268
+ var(--sprout-motion-ease, ease-out);
269
+ }
270
+ .sprout-questionnaire-item[data-active] {
271
+ animation: sprout-questionnaire-enter var(--sprout-motion-normal, 160ms)
272
+ var(--sprout-motion-ease, ease-out);
273
+ }
274
+ .sprout-questionnaire-choice[data-checked]
275
+ :is(
276
+ .sprout-questionnaire-choice-dot,
277
+ .sprout-questionnaire-choice-check
278
+ ) {
279
+ animation: sprout-questionnaire-pop var(--sprout-motion-fast, 140ms)
280
+ ease-out both;
281
+ }
282
+ }
283
+ @keyframes sprout-questionnaire-enter {
284
+ from {
285
+ opacity: 0;
286
+ transform: translateY(4px);
287
+ }
288
+ }
289
+ @keyframes sprout-questionnaire-pop {
290
+ from {
291
+ opacity: 0;
292
+ transform: scale(0.6);
293
+ }
294
+ }
295
+
296
+ @media (forced-colors: active) {
297
+ .sprout-questionnaire-choice[data-checked],
298
+ .sprout-questionnaire-choice[data-checked]
299
+ .sprout-questionnaire-choice-indicator {
300
+ border-color: Highlight;
301
+ }
302
+ .sprout-questionnaire-choice:has(
303
+ > .sprout-questionnaire-choice-input:focus-visible
304
+ ) {
305
+ outline-color: Highlight;
306
+ }
307
+ }
308
+ }
@@ -0,0 +1,119 @@
1
+ @layer components {
2
+ .sprout-radio-group {
3
+ display: grid;
4
+ gap: 8px;
5
+ width: 100%;
6
+ min-width: 0;
7
+ }
8
+
9
+ .sprout-radio-group-item {
10
+ position: relative;
11
+ display: inline-flex;
12
+ flex-shrink: 0;
13
+ align-items: center;
14
+ justify-content: center;
15
+ box-sizing: border-box;
16
+ width: 16px;
17
+ height: 16px;
18
+ padding: 0;
19
+ border: 1px solid var(--sprout-border);
20
+ border-radius: 999px;
21
+ background-color: var(--sprout-surface);
22
+ color: var(--sprout-on-primary);
23
+ vertical-align: middle;
24
+ cursor: pointer;
25
+ outline: 0 solid transparent;
26
+ outline-offset: 0;
27
+ -webkit-tap-highlight-color: transparent;
28
+ }
29
+ /* A 40 x 32px hit area around the 16px dot. */
30
+ .sprout-radio-group-item::after {
31
+ content: "";
32
+ position: absolute;
33
+ inset: -8px -12px;
34
+ }
35
+ @media (hover: hover) {
36
+ .sprout-radio-group-item:not(
37
+ [data-disabled],
38
+ [data-readonly],
39
+ [data-checked]
40
+ ):hover {
41
+ border-color: var(--sprout-border-strong);
42
+ }
43
+ }
44
+ .sprout-radio-group-item:focus-visible {
45
+ outline: var(--sprout-focus-width) solid var(--sprout-focus-ring);
46
+ }
47
+ .sprout-radio-group-item[data-checked] {
48
+ border-color: var(--sprout-primary);
49
+ background-color: var(--sprout-primary);
50
+ }
51
+ .sprout-radio-group-item[aria-invalid="true"] {
52
+ box-shadow: 0 0 0 3px
53
+ color-mix(in oklab, var(--sprout-danger) 20%, transparent);
54
+ }
55
+ .sprout-radio-group-item[aria-invalid="true"]:not([data-checked]) {
56
+ border-color: var(--sprout-danger);
57
+ }
58
+ .sprout-radio-group-item[aria-invalid="true"]:focus-visible {
59
+ outline-color: var(--sprout-danger);
60
+ }
61
+ .sprout-radio-group-item[data-readonly] {
62
+ cursor: default;
63
+ }
64
+ .sprout-radio-group-item[data-disabled] {
65
+ cursor: not-allowed;
66
+ opacity: 0.5;
67
+ }
68
+
69
+ .sprout-radio-group-indicator {
70
+ width: 8px;
71
+ height: 8px;
72
+ border-radius: 999px;
73
+ background-color: currentColor;
74
+ pointer-events: none;
75
+ }
76
+
77
+ @media (prefers-reduced-motion: no-preference) {
78
+ .sprout-radio-group-item {
79
+ transition:
80
+ background-color var(--sprout-motion-fast, 120ms)
81
+ var(--sprout-motion-ease, ease-out),
82
+ border-color var(--sprout-motion-fast, 120ms)
83
+ var(--sprout-motion-ease, ease-out),
84
+ box-shadow var(--sprout-motion-fast, 120ms)
85
+ var(--sprout-motion-ease, ease-out),
86
+ opacity var(--sprout-motion-fast, 120ms)
87
+ var(--sprout-motion-ease, ease-out);
88
+ }
89
+ .sprout-radio-group-indicator {
90
+ transition:
91
+ opacity var(--sprout-motion-normal, 180ms)
92
+ var(--sprout-motion-ease, ease-out),
93
+ transform var(--sprout-motion-normal, 180ms)
94
+ var(--sprout-motion-ease, ease-out);
95
+ }
96
+ .sprout-radio-group-indicator[data-starting-style],
97
+ .sprout-radio-group-indicator[data-ending-style] {
98
+ opacity: 0;
99
+ transform: scale(0.4);
100
+ }
101
+ }
102
+
103
+ @media (forced-colors: active) {
104
+ .sprout-radio-group-item {
105
+ border-color: CanvasText;
106
+ }
107
+ .sprout-radio-group-item[data-checked] {
108
+ border-color: Highlight;
109
+ background-color: Highlight;
110
+ color: HighlightText;
111
+ }
112
+ .sprout-radio-group-indicator {
113
+ background-color: HighlightText;
114
+ }
115
+ .sprout-radio-group-item:focus-visible {
116
+ outline-color: Highlight;
117
+ }
118
+ }
119
+ }