@tulipfarm/sprout 0.0.0-stage → 0.1.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 (306) 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 +78 -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-plan.d.ts +21 -0
  38. package/dist/components/chat-plan.js +35 -0
  39. package/dist/components/chat-sources.d.ts +64 -0
  40. package/dist/components/chat-sources.js +66 -0
  41. package/dist/components/checkbox.d.ts +16 -0
  42. package/dist/components/checkbox.js +17 -0
  43. package/dist/components/choice-list.d.ts +53 -0
  44. package/dist/components/choice-list.js +36 -0
  45. package/dist/components/code-block.d.ts +35 -0
  46. package/dist/components/code-block.js +95 -0
  47. package/dist/components/collapsible.d.ts +24 -0
  48. package/dist/components/collapsible.js +27 -0
  49. package/dist/components/combobox.d.ts +95 -0
  50. package/dist/components/combobox.js +106 -0
  51. package/dist/components/command.d.ts +94 -0
  52. package/dist/components/command.js +414 -0
  53. package/dist/components/context-menu.d.ts +57 -0
  54. package/dist/components/context-menu.js +60 -0
  55. package/dist/components/dialog.d.ts +60 -0
  56. package/dist/components/dialog.js +79 -0
  57. package/dist/components/direction.d.ts +6 -0
  58. package/dist/components/direction.js +6 -0
  59. package/dist/components/dropdown-menu.d.ts +62 -0
  60. package/dist/components/dropdown-menu.js +59 -0
  61. package/dist/components/field.d.ts +117 -0
  62. package/dist/components/field.js +150 -0
  63. package/dist/components/file-viewer.d.ts +120 -0
  64. package/dist/components/file-viewer.js +373 -0
  65. package/dist/components/form.d.ts +87 -0
  66. package/dist/components/form.js +55 -0
  67. package/dist/components/glass-banner.d.ts +27 -0
  68. package/dist/components/glass-banner.js +116 -0
  69. package/dist/components/gradient-banner.d.ts +37 -0
  70. package/dist/components/gradient-banner.js +43 -0
  71. package/dist/components/hover-card.d.ts +27 -0
  72. package/dist/components/hover-card.js +26 -0
  73. package/dist/components/input-group.d.ts +68 -0
  74. package/dist/components/input-group.js +88 -0
  75. package/dist/components/input-otp.d.ts +38 -0
  76. package/dist/components/input-otp.js +43 -0
  77. package/dist/components/input.d.ts +16 -0
  78. package/dist/components/input.js +18 -0
  79. package/dist/components/kbd.d.ts +12 -0
  80. package/dist/components/kbd.js +11 -0
  81. package/dist/components/label.d.ts +8 -0
  82. package/dist/components/label.js +10 -0
  83. package/dist/components/mention-list.d.ts +54 -0
  84. package/dist/components/mention-list.js +31 -0
  85. package/dist/components/menubar.d.ts +64 -0
  86. package/dist/components/menubar.js +68 -0
  87. package/dist/components/message-actions.d.ts +34 -0
  88. package/dist/components/message-actions.js +68 -0
  89. package/dist/components/message-response.d.ts +20 -0
  90. package/dist/components/message-response.js +46 -0
  91. package/dist/components/message-scroller.d.ts +71 -0
  92. package/dist/components/message-scroller.js +217 -0
  93. package/dist/components/message.d.ts +49 -0
  94. package/dist/components/message.js +59 -0
  95. package/dist/components/navigation-menu.d.ts +45 -0
  96. package/dist/components/navigation-menu.js +54 -0
  97. package/dist/components/notice-banner.d.ts +14 -0
  98. package/dist/components/notice-banner.js +11 -0
  99. package/dist/components/page-content.d.ts +7 -0
  100. package/dist/components/page-content.js +9 -0
  101. package/dist/components/page-header.d.ts +37 -0
  102. package/dist/components/page-header.js +53 -0
  103. package/dist/components/pagination.d.ts +29 -0
  104. package/dist/components/pagination.js +29 -0
  105. package/dist/components/plan-outline.d.ts +60 -0
  106. package/dist/components/plan-outline.js +108 -0
  107. package/dist/components/popover.d.ts +34 -0
  108. package/dist/components/popover.js +35 -0
  109. package/dist/components/progress.d.ts +27 -0
  110. package/dist/components/progress.js +35 -0
  111. package/dist/components/prompt-list.d.ts +23 -0
  112. package/dist/components/prompt-list.js +11 -0
  113. package/dist/components/questionnaire.d.ts +148 -0
  114. package/dist/components/questionnaire.js +1001 -0
  115. package/dist/components/radio-group.d.ts +16 -0
  116. package/dist/components/radio-group.js +21 -0
  117. package/dist/components/reasoning-effort.d.ts +24 -0
  118. package/dist/components/reasoning-effort.js +269 -0
  119. package/dist/components/resizable.d.ts +67 -0
  120. package/dist/components/resizable.js +536 -0
  121. package/dist/components/result-card.d.ts +58 -0
  122. package/dist/components/result-card.js +88 -0
  123. package/dist/components/review-card.d.ts +62 -0
  124. package/dist/components/review-card.js +49 -0
  125. package/dist/components/rich-text-editor.d.ts +51 -0
  126. package/dist/components/rich-text-editor.js +248 -0
  127. package/dist/components/schema-diagram.d.ts +52 -0
  128. package/dist/components/schema-diagram.js +226 -0
  129. package/dist/components/scroll-area.d.ts +22 -0
  130. package/dist/components/scroll-area.js +19 -0
  131. package/dist/components/search-dialog.d.ts +103 -0
  132. package/dist/components/search-dialog.js +64 -0
  133. package/dist/components/search-field.d.ts +17 -0
  134. package/dist/components/search-field.js +27 -0
  135. package/dist/components/select.d.ts +57 -0
  136. package/dist/components/select.js +57 -0
  137. package/dist/components/selection-slot.d.ts +18 -0
  138. package/dist/components/selection-slot.js +53 -0
  139. package/dist/components/separator.d.ts +48 -0
  140. package/dist/components/separator.js +54 -0
  141. package/dist/components/settings-list.d.ts +26 -0
  142. package/dist/components/settings-list.js +17 -0
  143. package/dist/components/sheet.d.ts +70 -0
  144. package/dist/components/sheet.js +77 -0
  145. package/dist/components/sidebar.d.ts +70 -0
  146. package/dist/components/sidebar.js +187 -0
  147. package/dist/components/skeleton.d.ts +31 -0
  148. package/dist/components/skeleton.js +32 -0
  149. package/dist/components/slider.d.ts +17 -0
  150. package/dist/components/slider.js +24 -0
  151. package/dist/components/spinner.d.ts +37 -0
  152. package/dist/components/spinner.js +43 -0
  153. package/dist/components/state-panel-samples.d.ts +25 -0
  154. package/dist/components/state-panel-samples.js +423 -0
  155. package/dist/components/state-panel.d.ts +35 -0
  156. package/dist/components/state-panel.js +29 -0
  157. package/dist/components/state-sample.d.ts +63 -0
  158. package/dist/components/state-sample.js +42 -0
  159. package/dist/components/switch.d.ts +12 -0
  160. package/dist/components/switch.js +14 -0
  161. package/dist/components/table-nuqs.d.ts +16 -0
  162. package/dist/components/table-nuqs.js +59 -0
  163. package/dist/components/table.d.ts +120 -0
  164. package/dist/components/table.js +663 -0
  165. package/dist/components/tabs.d.ts +37 -0
  166. package/dist/components/tabs.js +36 -0
  167. package/dist/components/textarea.d.ts +18 -0
  168. package/dist/components/textarea.js +19 -0
  169. package/dist/components/toast.d.ts +45 -0
  170. package/dist/components/toast.js +83 -0
  171. package/dist/components/toggle-group.d.ts +30 -0
  172. package/dist/components/toggle-group.js +39 -0
  173. package/dist/components/toggle.d.ts +27 -0
  174. package/dist/components/toggle.js +21 -0
  175. package/dist/components/tool-activity.d.ts +79 -0
  176. package/dist/components/tool-activity.js +226 -0
  177. package/dist/components/toolbar-status.d.ts +21 -0
  178. package/dist/components/toolbar-status.js +14 -0
  179. package/dist/components/tooltip.d.ts +31 -0
  180. package/dist/components/tooltip.js +99 -0
  181. package/dist/components/typed-text.d.ts +17 -0
  182. package/dist/components/typed-text.js +56 -0
  183. package/dist/index.d.ts +88 -0
  184. package/dist/index.js +88 -0
  185. package/dist/internal/brand-glyphs.d.ts +342 -0
  186. package/dist/internal/brand-glyphs.js +238 -0
  187. package/dist/internal/classes.d.ts +3 -0
  188. package/dist/internal/classes.js +20 -0
  189. package/dist/internal/fieldset.d.ts +6 -0
  190. package/dist/internal/fieldset.js +38 -0
  191. package/dist/internal/file-kind.d.ts +4 -0
  192. package/dist/internal/file-kind.js +62 -0
  193. package/dist/internal/languages.d.ts +7 -0
  194. package/dist/internal/languages.js +1010 -0
  195. package/dist/internal/message-scroller.d.ts +102 -0
  196. package/dist/internal/message-scroller.js +637 -0
  197. package/dist/internal/pressable.d.ts +2 -0
  198. package/dist/internal/pressable.js +29 -0
  199. package/dist/internal/syntax.d.ts +14 -0
  200. package/dist/internal/syntax.js +137 -0
  201. package/dist/styles/accordion.css +102 -0
  202. package/dist/styles/alert-dialog.css +198 -0
  203. package/dist/styles/alert.css +149 -0
  204. package/dist/styles/aspect-ratio.css +8 -0
  205. package/dist/styles/attachment.css +720 -0
  206. package/dist/styles/avatar.css +186 -0
  207. package/dist/styles/badge.css +178 -0
  208. package/dist/styles/brand-icon.css +104 -0
  209. package/dist/styles/breadcrumb.css +121 -0
  210. package/dist/styles/button-group.css +113 -0
  211. package/dist/styles/button.css +380 -0
  212. package/dist/styles/calendar.css +295 -0
  213. package/dist/styles/canvas.css +327 -0
  214. package/dist/styles/card.css +146 -0
  215. package/dist/styles/carousel.css +107 -0
  216. package/dist/styles/chart.css +227 -0
  217. package/dist/styles/chat-confirmation.css +29 -0
  218. package/dist/styles/chat-plan.css +109 -0
  219. package/dist/styles/chat-sources.css +191 -0
  220. package/dist/styles/checkbox.css +123 -0
  221. package/dist/styles/choice-list.css +343 -0
  222. package/dist/styles/code-block.css +211 -0
  223. package/dist/styles/collapsible.css +72 -0
  224. package/dist/styles/combobox.css +347 -0
  225. package/dist/styles/command.css +233 -0
  226. package/dist/styles/context-menu.css +151 -0
  227. package/dist/styles/dialog.css +237 -0
  228. package/dist/styles/dropdown-menu.css +150 -0
  229. package/dist/styles/field.css +341 -0
  230. package/dist/styles/file-viewer.css +278 -0
  231. package/dist/styles/form.css +155 -0
  232. package/dist/styles/glass-banner.css +308 -0
  233. package/dist/styles/gradient-banner.css +256 -0
  234. package/dist/styles/hover-card.css +95 -0
  235. package/dist/styles/index.css +262 -0
  236. package/dist/styles/input-group.css +290 -0
  237. package/dist/styles/input-otp.css +138 -0
  238. package/dist/styles/input.css +99 -0
  239. package/dist/styles/kbd.css +59 -0
  240. package/dist/styles/label.css +89 -0
  241. package/dist/styles/mention-list.css +166 -0
  242. package/dist/styles/menubar.css +226 -0
  243. package/dist/styles/message-actions.css +83 -0
  244. package/dist/styles/message-response.css +176 -0
  245. package/dist/styles/message-scroller.css +136 -0
  246. package/dist/styles/message.css +310 -0
  247. package/dist/styles/navigation-menu.css +291 -0
  248. package/dist/styles/notice-banner.css +68 -0
  249. package/dist/styles/page-content.css +21 -0
  250. package/dist/styles/page-header.css +156 -0
  251. package/dist/styles/pagination.css +72 -0
  252. package/dist/styles/plan-outline.css +393 -0
  253. package/dist/styles/popover.css +140 -0
  254. package/dist/styles/progress.css +93 -0
  255. package/dist/styles/prompt-list.css +165 -0
  256. package/dist/styles/questionnaire.css +323 -0
  257. package/dist/styles/radio-group.css +120 -0
  258. package/dist/styles/reasoning-effort.css +157 -0
  259. package/dist/styles/resizable.css +108 -0
  260. package/dist/styles/result-card.css +215 -0
  261. package/dist/styles/review-card.css +235 -0
  262. package/dist/styles/rich-text-editor.css +169 -0
  263. package/dist/styles/schema-diagram.css +419 -0
  264. package/dist/styles/scroll-area.css +77 -0
  265. package/dist/styles/search-dialog.css +363 -0
  266. package/dist/styles/search-field.css +17 -0
  267. package/dist/styles/select.css +285 -0
  268. package/dist/styles/selection-slot.css +31 -0
  269. package/dist/styles/separator.css +206 -0
  270. package/dist/styles/settings-list.css +81 -0
  271. package/dist/styles/sheet.css +361 -0
  272. package/dist/styles/sidebar.css +363 -0
  273. package/dist/styles/skeleton.css +80 -0
  274. package/dist/styles/slider.css +142 -0
  275. package/dist/styles/spinner.css +39 -0
  276. package/dist/styles/state-panel-samples.css +41 -0
  277. package/dist/styles/state-panel.css +182 -0
  278. package/dist/styles/state-sample.css +285 -0
  279. package/dist/styles/switch.css +128 -0
  280. package/dist/styles/table.css +604 -0
  281. package/dist/styles/tabs.css +223 -0
  282. package/dist/styles/textarea.css +78 -0
  283. package/dist/styles/themes/chatgpt.css +125 -0
  284. package/dist/styles/themes/claude.css +125 -0
  285. package/dist/styles/themes/cloudflare.css +125 -0
  286. package/dist/styles/themes/discord.css +125 -0
  287. package/dist/styles/themes/github.css +125 -0
  288. package/dist/styles/themes/grok.css +125 -0
  289. package/dist/styles/themes/linear.css +126 -0
  290. package/dist/styles/themes/neutral.css +125 -0
  291. package/dist/styles/themes/notion.css +125 -0
  292. package/dist/styles/themes/perplexity.css +125 -0
  293. package/dist/styles/themes/raycast.css +125 -0
  294. package/dist/styles/themes/spotify.css +125 -0
  295. package/dist/styles/themes/stripe.css +125 -0
  296. package/dist/styles/themes/supabase.css +125 -0
  297. package/dist/styles/themes/tulipfarm.css +125 -0
  298. package/dist/styles/themes/vercel.css +126 -0
  299. package/dist/styles/toast.css +197 -0
  300. package/dist/styles/toggle-group.css +161 -0
  301. package/dist/styles/toggle.css +119 -0
  302. package/dist/styles/tool-activity.css +396 -0
  303. package/dist/styles/toolbar-status.css +52 -0
  304. package/dist/styles/tooltip.css +122 -0
  305. package/dist/styles/typed-text.css +17 -0
  306. package/package.json +443 -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: 1px;
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: 2px solid var(--sprout-focus);
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,323 @@
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: 2px;
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
+ border-color: var(--sprout-focus);
97
+ outline: 2px solid var(--sprout-focus);
98
+ }
99
+ .sprout-questionnaire-choice[data-checked] {
100
+ border-color: var(--sprout-focus);
101
+ background: var(--sprout-primary-subtle);
102
+ }
103
+ .sprout-questionnaire-choice[data-invalid] {
104
+ border-color: var(--sprout-danger);
105
+ }
106
+ .sprout-questionnaire-choice[data-invalid]:has(
107
+ > .sprout-questionnaire-choice-input:focus-visible
108
+ ) {
109
+ outline-color: var(--sprout-danger);
110
+ }
111
+ .sprout-questionnaire-choice[data-disabled] {
112
+ cursor: not-allowed;
113
+ opacity: 0.5;
114
+ }
115
+
116
+ /* The real input covers the row so any click or tap reaches it. */
117
+ .sprout-questionnaire-choice-input {
118
+ position: absolute;
119
+ inset: -1px;
120
+ z-index: 1;
121
+ width: calc(100% + 2px);
122
+ height: calc(100% + 2px);
123
+ margin: 0;
124
+ opacity: 0;
125
+ cursor: inherit;
126
+ }
127
+
128
+ .sprout-questionnaire-choice-indicator {
129
+ position: relative;
130
+ display: flex;
131
+ flex-shrink: 0;
132
+ align-items: center;
133
+ justify-content: center;
134
+ box-sizing: border-box;
135
+ width: 16px;
136
+ height: 16px;
137
+ margin-top: 2px;
138
+ border: 1px solid var(--sprout-border);
139
+ border-radius: 4px;
140
+ background: var(--sprout-surface);
141
+ color: var(--sprout-on-primary);
142
+ pointer-events: none;
143
+ }
144
+ .sprout-questionnaire-choice[data-type="radio"]
145
+ .sprout-questionnaire-choice-indicator {
146
+ border-radius: 999px;
147
+ }
148
+ .sprout-questionnaire-choice[data-checked]
149
+ .sprout-questionnaire-choice-indicator {
150
+ border-color: var(--sprout-primary);
151
+ background: var(--sprout-primary);
152
+ }
153
+ .sprout-questionnaire-choice-dot,
154
+ .sprout-questionnaire-choice-check {
155
+ display: none;
156
+ }
157
+ .sprout-questionnaire-choice-dot {
158
+ width: 6px;
159
+ height: 6px;
160
+ border-radius: 999px;
161
+ background: var(--sprout-on-primary);
162
+ }
163
+ .sprout-questionnaire-choice-check {
164
+ width: 12px;
165
+ height: 12px;
166
+ }
167
+ .sprout-questionnaire-choice[data-type="radio"][data-checked]
168
+ .sprout-questionnaire-choice-dot,
169
+ .sprout-questionnaire-choice[data-type="checkbox"][data-checked]
170
+ .sprout-questionnaire-choice-check {
171
+ display: block;
172
+ }
173
+
174
+ .sprout-questionnaire-choice-label {
175
+ display: flex;
176
+ flex: 1;
177
+ flex-direction: column;
178
+ gap: 2px;
179
+ min-width: 0;
180
+ overflow-wrap: anywhere;
181
+ }
182
+ .sprout-questionnaire-choice-description {
183
+ color: var(--sprout-muted);
184
+ }
185
+
186
+ .sprout-questionnaire-choice-shortcut {
187
+ display: inline-flex;
188
+ flex-shrink: 0;
189
+ align-items: center;
190
+ justify-content: center;
191
+ box-sizing: border-box;
192
+ width: 20px;
193
+ height: 20px;
194
+ margin-inline-start: auto;
195
+ border: 1px solid var(--sprout-line);
196
+ border-radius: calc(var(--sprout-radius-control) - 2px);
197
+ background: var(--sprout-surface);
198
+ font-size: var(--sprout-text-xs);
199
+ font-weight: 500;
200
+ line-height: 1;
201
+ font-variant-numeric: tabular-nums;
202
+ color: var(--sprout-muted);
203
+ pointer-events: none;
204
+ }
205
+ .sprout-questionnaire-choice[data-checked]
206
+ .sprout-questionnaire-choice-shortcut {
207
+ border-color: color-mix(
208
+ in oklab,
209
+ var(--sprout-focus) 40%,
210
+ var(--sprout-line)
211
+ );
212
+ color: var(--sprout-text);
213
+ }
214
+
215
+ .sprout-questionnaire-input-wrapper {
216
+ position: relative;
217
+ width: 100%;
218
+ min-width: 0;
219
+ }
220
+
221
+ .sprout-questionnaire-error {
222
+ margin: 0;
223
+ font-size: var(--sprout-text-sm);
224
+ line-height: 1.25rem;
225
+ color: var(--sprout-danger);
226
+ }
227
+ .sprout-questionnaire-error[hidden] {
228
+ display: none;
229
+ }
230
+
231
+ .sprout-questionnaire-actions {
232
+ display: grid;
233
+ grid-template-columns: minmax(0, 1fr) auto auto;
234
+ align-items: center;
235
+ gap: 8px;
236
+ width: 100%;
237
+ min-height: 28px;
238
+ }
239
+ .sprout-questionnaire-actions .sprout-questionnaire-action[hidden] {
240
+ display: none;
241
+ }
242
+ .sprout-questionnaire-previous {
243
+ grid-row: 1;
244
+ grid-column: 1;
245
+ justify-self: start;
246
+ }
247
+ .sprout-questionnaire-skip {
248
+ grid-row: 1;
249
+ grid-column: 2;
250
+ justify-self: end;
251
+ }
252
+ .sprout-questionnaire-next,
253
+ .sprout-questionnaire-submit {
254
+ grid-row: 1;
255
+ grid-column: 3;
256
+ justify-self: end;
257
+ }
258
+
259
+ /* Phones get 44px targets. */
260
+ @media (max-width: 639.98px) {
261
+ .sprout-questionnaire-actions {
262
+ min-height: 44px;
263
+ }
264
+ .sprout-questionnaire-action,
265
+ .sprout-questionnaire-input {
266
+ min-height: 44px;
267
+ }
268
+ .sprout-questionnaire-input {
269
+ font-size: var(--sprout-text-base);
270
+ }
271
+ }
272
+
273
+ @media (prefers-reduced-motion: no-preference) {
274
+ .sprout-questionnaire-choice,
275
+ .sprout-questionnaire-choice-indicator,
276
+ .sprout-questionnaire-choice-shortcut {
277
+ transition:
278
+ background-color var(--sprout-motion-fast, 120ms)
279
+ var(--sprout-motion-ease, ease-out),
280
+ border-color var(--sprout-motion-fast, 120ms)
281
+ var(--sprout-motion-ease, ease-out),
282
+ color var(--sprout-motion-fast, 120ms)
283
+ var(--sprout-motion-ease, ease-out);
284
+ }
285
+ .sprout-questionnaire-item[data-active] {
286
+ animation: sprout-questionnaire-enter var(--sprout-motion-normal, 160ms)
287
+ var(--sprout-motion-ease, ease-out);
288
+ }
289
+ .sprout-questionnaire-choice[data-checked]
290
+ :is(
291
+ .sprout-questionnaire-choice-dot,
292
+ .sprout-questionnaire-choice-check
293
+ ) {
294
+ animation: sprout-questionnaire-pop var(--sprout-motion-fast, 140ms)
295
+ ease-out both;
296
+ }
297
+ }
298
+ @keyframes sprout-questionnaire-enter {
299
+ from {
300
+ opacity: 0;
301
+ transform: translateY(4px);
302
+ }
303
+ }
304
+ @keyframes sprout-questionnaire-pop {
305
+ from {
306
+ opacity: 0;
307
+ transform: scale(0.6);
308
+ }
309
+ }
310
+
311
+ @media (forced-colors: active) {
312
+ .sprout-questionnaire-choice[data-checked],
313
+ .sprout-questionnaire-choice[data-checked]
314
+ .sprout-questionnaire-choice-indicator {
315
+ border-color: Highlight;
316
+ }
317
+ .sprout-questionnaire-choice:has(
318
+ > .sprout-questionnaire-choice-input:focus-visible
319
+ ) {
320
+ outline-color: Highlight;
321
+ }
322
+ }
323
+ }
@@ -0,0 +1,120 @@
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: 2px;
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
+ border-color: var(--sprout-focus);
46
+ outline: 2px solid var(--sprout-focus);
47
+ }
48
+ .sprout-radio-group-item[data-checked] {
49
+ border-color: var(--sprout-primary);
50
+ background-color: var(--sprout-primary);
51
+ }
52
+ .sprout-radio-group-item[aria-invalid="true"] {
53
+ box-shadow: 0 0 0 3px
54
+ color-mix(in oklab, var(--sprout-danger) 20%, transparent);
55
+ }
56
+ .sprout-radio-group-item[aria-invalid="true"]:not([data-checked]) {
57
+ border-color: var(--sprout-danger);
58
+ }
59
+ .sprout-radio-group-item[aria-invalid="true"]:focus-visible {
60
+ outline-color: var(--sprout-danger);
61
+ }
62
+ .sprout-radio-group-item[data-readonly] {
63
+ cursor: default;
64
+ }
65
+ .sprout-radio-group-item[data-disabled] {
66
+ cursor: not-allowed;
67
+ opacity: 0.5;
68
+ }
69
+
70
+ .sprout-radio-group-indicator {
71
+ width: 8px;
72
+ height: 8px;
73
+ border-radius: 999px;
74
+ background-color: currentColor;
75
+ pointer-events: none;
76
+ }
77
+
78
+ @media (prefers-reduced-motion: no-preference) {
79
+ .sprout-radio-group-item {
80
+ transition:
81
+ background-color var(--sprout-motion-fast, 120ms)
82
+ var(--sprout-motion-ease, ease-out),
83
+ border-color var(--sprout-motion-fast, 120ms)
84
+ var(--sprout-motion-ease, ease-out),
85
+ box-shadow var(--sprout-motion-fast, 120ms)
86
+ var(--sprout-motion-ease, ease-out),
87
+ opacity var(--sprout-motion-fast, 120ms)
88
+ var(--sprout-motion-ease, ease-out);
89
+ }
90
+ .sprout-radio-group-indicator {
91
+ transition:
92
+ opacity var(--sprout-motion-normal, 180ms)
93
+ var(--sprout-motion-ease, ease-out),
94
+ transform var(--sprout-motion-normal, 180ms)
95
+ var(--sprout-motion-ease, ease-out);
96
+ }
97
+ .sprout-radio-group-indicator[data-starting-style],
98
+ .sprout-radio-group-indicator[data-ending-style] {
99
+ opacity: 0;
100
+ transform: scale(0.4);
101
+ }
102
+ }
103
+
104
+ @media (forced-colors: active) {
105
+ .sprout-radio-group-item {
106
+ border-color: CanvasText;
107
+ }
108
+ .sprout-radio-group-item[data-checked] {
109
+ border-color: Highlight;
110
+ background-color: Highlight;
111
+ color: HighlightText;
112
+ }
113
+ .sprout-radio-group-indicator {
114
+ background-color: HighlightText;
115
+ }
116
+ .sprout-radio-group-item:focus-visible {
117
+ outline-color: Highlight;
118
+ }
119
+ }
120
+ }