@tulipfarm/sprout 0.4.0 → 0.5.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 (89) hide show
  1. package/README.md +55 -53
  2. package/dist/components/agent-avatar.d.ts +27 -0
  3. package/dist/components/agent-avatar.js +67 -0
  4. package/dist/components/alert-dialog.d.ts +2 -2
  5. package/dist/components/alert-dialog.js +4 -4
  6. package/dist/components/attachment.d.ts +1 -1
  7. package/dist/components/attachment.js +2 -2
  8. package/dist/components/avatar.d.ts +2 -10
  9. package/dist/components/avatar.js +3 -40
  10. package/dist/components/board.js +4 -4
  11. package/dist/components/button.d.ts +2 -2
  12. package/dist/components/button.js +13 -29
  13. package/dist/components/card.d.ts +1 -1
  14. package/dist/components/card.js +2 -2
  15. package/dist/components/chat-input.js +3 -3
  16. package/dist/components/chat-sources.js +1 -1
  17. package/dist/components/combobox.d.ts +10 -4
  18. package/dist/components/combobox.js +6 -5
  19. package/dist/components/form.js +1 -1
  20. package/dist/components/gradient-banner.d.ts +2 -2
  21. package/dist/components/gradient-banner.js +1 -1
  22. package/dist/components/input-group.d.ts +7 -7
  23. package/dist/components/input-group.js +7 -7
  24. package/dist/components/input-otp.d.ts +6 -2
  25. package/dist/components/input-otp.js +5 -3
  26. package/dist/components/input.d.ts +2 -2
  27. package/dist/components/input.js +2 -2
  28. package/dist/components/page-header.js +1 -1
  29. package/dist/components/pagination.js +2 -2
  30. package/dist/components/questionnaire.js +1 -1
  31. package/dist/components/record-list.d.ts +2 -2
  32. package/dist/components/record-list.js +2 -2
  33. package/dist/components/result-card.js +1 -1
  34. package/dist/components/rich-text-editor.d.ts +3 -3
  35. package/dist/components/rich-text-editor.js +3 -3
  36. package/dist/components/scroll-area.d.ts +2 -2
  37. package/dist/components/scroll-area.js +2 -2
  38. package/dist/components/search-field.js +1 -1
  39. package/dist/components/select.d.ts +2 -6
  40. package/dist/components/select.js +2 -2
  41. package/dist/components/spinner.d.ts +2 -2
  42. package/dist/components/spinner.js +2 -2
  43. package/dist/components/state-panel-samples.js +13 -13
  44. package/dist/components/state-sample.d.ts +1 -1
  45. package/dist/components/state-sample.js +2 -2
  46. package/dist/components/switch.d.ts +2 -2
  47. package/dist/components/switch.js +2 -2
  48. package/dist/components/table.js +1 -1
  49. package/dist/components/toggle-group.d.ts +2 -2
  50. package/dist/components/toggle-group.js +3 -3
  51. package/dist/components/toggle.d.ts +2 -2
  52. package/dist/components/toggle.js +3 -3
  53. package/dist/index.d.ts +1 -0
  54. package/dist/index.js +1 -0
  55. package/dist/internal/agent-avatar-artwork.d.ts +4 -0
  56. package/dist/internal/agent-avatar-artwork.js +219 -0
  57. package/dist/internal/hash.d.ts +1 -0
  58. package/dist/internal/hash.js +9 -0
  59. package/dist/styles/alert-dialog.css +6 -6
  60. package/dist/styles/attachment.css +13 -13
  61. package/dist/styles/avatar.css +2 -14
  62. package/dist/styles/button-group.css +1 -1
  63. package/dist/styles/button.css +29 -154
  64. package/dist/styles/chat-sources.css +1 -0
  65. package/dist/styles/combobox.css +13 -2
  66. package/dist/styles/command.css +3 -1
  67. package/dist/styles/context-menu.css +2 -0
  68. package/dist/styles/dropdown-menu.css +2 -0
  69. package/dist/styles/gradient-banner.css +0 -5
  70. package/dist/styles/index.css +5 -4
  71. package/dist/styles/input-group.css +36 -28
  72. package/dist/styles/input-otp.css +13 -3
  73. package/dist/styles/input.css +14 -6
  74. package/dist/styles/menubar.css +4 -2
  75. package/dist/styles/navigation-menu.css +1 -1
  76. package/dist/styles/page-header.css +4 -0
  77. package/dist/styles/pagination.css +11 -2
  78. package/dist/styles/record-list.css +1 -1
  79. package/dist/styles/result-card.css +1 -1
  80. package/dist/styles/rich-text-editor.css +3 -3
  81. package/dist/styles/select.css +8 -12
  82. package/dist/styles/sidebar.css +15 -13
  83. package/dist/styles/state-sample.css +2 -2
  84. package/dist/styles/table.css +11 -4
  85. package/dist/styles/tabs.css +1 -3
  86. package/dist/styles/toggle-group.css +6 -6
  87. package/dist/styles/toggle.css +6 -6
  88. package/dist/styles/view-switcher.css +20 -2
  89. package/package.json +5 -1
@@ -3,7 +3,7 @@
3
3
  box-sizing: border-box;
4
4
  width: 100%;
5
5
  min-width: 0;
6
- height: 32px;
6
+ height: var(--sprout-control-height);
7
7
  margin: 0;
8
8
  padding: 4px 10px;
9
9
  border: 1px solid var(--sprout-input);
@@ -42,7 +42,7 @@
42
42
 
43
43
  .sprout-input[type='file'] {
44
44
  padding-block: 0;
45
- line-height: 30px;
45
+ line-height: calc(var(--sprout-control-height) - 2px);
46
46
  cursor: pointer;
47
47
  }
48
48
  .sprout-input[type='file']:disabled {
@@ -67,14 +67,22 @@
67
67
  opacity: 0.7;
68
68
  }
69
69
 
70
+ .sprout-input-scale-sm {
71
+ height: calc(var(--sprout-control-height) - 4px);
72
+ padding-inline: 8px;
73
+ border-radius: min(var(--sprout-radius-control), 12px);
74
+ font-size: var(--sprout-text-xs);
75
+ line-height: 16px;
76
+ }
70
77
  .sprout-input-scale-lg {
71
- height: 44px;
78
+ height: calc(var(--sprout-control-height) + 4px);
72
79
  padding-inline: 12px;
73
- font-size: var(--sprout-text-base);
74
- line-height: 24px;
80
+ }
81
+ .sprout-input-scale-sm[type='file'] {
82
+ line-height: calc(var(--sprout-control-height) - 6px);
75
83
  }
76
84
  .sprout-input-scale-lg[type='file'] {
77
- line-height: 42px;
85
+ line-height: calc(var(--sprout-control-height) + 2px);
78
86
  }
79
87
 
80
88
  @media (prefers-reduced-motion: no-preference) {
@@ -6,7 +6,7 @@
6
6
  gap: 2px;
7
7
  width: fit-content;
8
8
  max-width: 100%;
9
- height: 32px;
9
+ height: var(--sprout-control-height);
10
10
  padding: 3px;
11
11
  border: 1px solid var(--sprout-line);
12
12
  border-radius: var(--sprout-radius-panel);
@@ -32,7 +32,7 @@
32
32
  flex-shrink: 0;
33
33
  align-items: center;
34
34
  gap: 6px;
35
- height: 24px;
35
+ height: calc(var(--sprout-control-height) - 8px);
36
36
  padding: 2px 8px;
37
37
  border: 0;
38
38
  border-radius: var(--sprout-radius-control);
@@ -113,10 +113,12 @@
113
113
 
114
114
  .sprout-menubar-item {
115
115
  position: relative;
116
+ box-sizing: border-box;
116
117
  display: flex;
117
118
  align-items: center;
118
119
  gap: 6px;
119
120
  min-width: 0;
121
+ min-height: calc(var(--sprout-control-height) - 4px);
120
122
  padding: 4px 6px;
121
123
  border-radius: var(--sprout-radius-control);
122
124
  color: var(--sprout-text);
@@ -38,7 +38,7 @@
38
38
  gap: 4px;
39
39
  width: max-content;
40
40
  max-width: 100%;
41
- height: 32px;
41
+ height: var(--sprout-control-height);
42
42
  margin: 0;
43
43
  padding: 0 10px;
44
44
  border: 0;
@@ -133,6 +133,10 @@
133
133
  }
134
134
 
135
135
  @media (max-width: 639px) {
136
+ .sprout-page-header-back {
137
+ width: calc(var(--sprout-control-height) - 4px);
138
+ padding-inline: 0;
139
+ }
136
140
  .sprout-page-header-back-label {
137
141
  position: absolute;
138
142
  width: 1px;
@@ -36,10 +36,19 @@
36
36
  display: flex;
37
37
  align-items: center;
38
38
  justify-content: center;
39
- width: 32px;
40
- height: 32px;
39
+ width: var(--sprout-control-height);
40
+ height: var(--sprout-control-height);
41
41
  color: var(--sprout-muted);
42
42
  }
43
+ /* The ellipsis has no size prop, so it matches the links around it. */
44
+ .sprout-pagination-content:has(.sprout-button-size-sm, .sprout-button-size-icon-sm) .sprout-pagination-ellipsis {
45
+ width: calc(var(--sprout-control-height) - 4px);
46
+ height: calc(var(--sprout-control-height) - 4px);
47
+ }
48
+ .sprout-pagination-content:has(.sprout-button-size-lg, .sprout-button-size-icon-lg) .sprout-pagination-ellipsis {
49
+ width: calc(var(--sprout-control-height) + 4px);
50
+ height: calc(var(--sprout-control-height) + 4px);
51
+ }
43
52
  .sprout-pagination-ellipsis > svg {
44
53
  width: 16px;
45
54
  height: 16px;
@@ -16,7 +16,7 @@
16
16
  line-height: 1.25rem;
17
17
  overflow: hidden;
18
18
  }
19
- .sprout-record-list[data-density='compact'] {
19
+ .sprout-record-list[data-density='sm'] {
20
20
  --sprout-record-list-pad-y: 0.5rem;
21
21
  --sprout-record-list-pad-x: 0.75rem;
22
22
  }
@@ -124,7 +124,7 @@
124
124
  .sprout-result-card-app + .sprout-result-card-app {
125
125
  margin-inline-start: -8px;
126
126
  }
127
- .sprout-result-card-action .sprout-button-size-result-card {
127
+ .sprout-result-card-action .sprout-button {
128
128
  height: 44px;
129
129
  }
130
130
  }
@@ -5,7 +5,7 @@
5
5
  min-width: 0;
6
6
  color: var(--sprout-text);
7
7
  }
8
- .sprout-rich-text-editor-size-compact,
8
+ .sprout-rich-text-editor-size-sm,
9
9
  .sprout-rich-text-editor-condensed {
10
10
  display: flex;
11
11
  align-items: flex-end;
@@ -21,7 +21,7 @@
21
21
  /* Holds the editor's height before Tiptap mounts on the client. */
22
22
  min-height: 5rem;
23
23
  }
24
- .sprout-rich-text-editor-size-compact > .sprout-rich-text-editor-body,
24
+ .sprout-rich-text-editor-size-sm > .sprout-rich-text-editor-body,
25
25
  .sprout-rich-text-editor-condensed > .sprout-rich-text-editor-body {
26
26
  min-height: 2.5rem;
27
27
  }
@@ -41,7 +41,7 @@
41
41
  outline: 0 solid transparent;
42
42
  outline-offset: 0;
43
43
  }
44
- .sprout-rich-text-editor-size-compact .sprout-rich-text-editor-content {
44
+ .sprout-rich-text-editor-size-sm .sprout-rich-text-editor-content {
45
45
  min-height: 2.5rem;
46
46
  max-height: 8rem;
47
47
  font-size: var(--sprout-text-sm);
@@ -8,7 +8,7 @@
8
8
  gap: 6px;
9
9
  min-width: 0;
10
10
  max-width: 100%;
11
- height: 32px;
11
+ height: var(--sprout-control-height);
12
12
  padding: 0 8px 0 10px;
13
13
  border: 1px solid var(--sprout-input);
14
14
  border-radius: var(--sprout-radius-control);
@@ -69,17 +69,15 @@
69
69
  .sprout-select-trigger-sm {
70
70
  --sprout-select-icon: 0.875rem;
71
71
  gap: 4px;
72
- height: 28px;
72
+ height: calc(var(--sprout-control-height) - 4px);
73
73
  padding: 0 6px 0 8px;
74
74
  border-radius: min(var(--sprout-radius-control), 12px);
75
75
  font-size: var(--sprout-text-xs);
76
+ line-height: 16px;
76
77
  }
77
- .sprout-select-trigger-calendar {
78
- --sprout-select-icon: 0.875rem;
79
- gap: 4px;
80
- height: 32px;
81
- padding: 0 6px 0 8px;
82
- font-size: var(--sprout-text-xs);
78
+ .sprout-select-trigger-lg {
79
+ height: calc(var(--sprout-control-height) + 4px);
80
+ padding: 0 10px 0 12px;
83
81
  }
84
82
  .sprout-select-trigger-fit {
85
83
  width: fit-content;
@@ -155,11 +153,12 @@
155
153
 
156
154
  .sprout-select-item {
157
155
  position: relative;
156
+ box-sizing: border-box;
158
157
  display: flex;
159
158
  align-items: center;
160
159
  gap: 6px;
161
160
  min-width: 0;
162
- min-height: 28px;
161
+ min-height: calc(var(--sprout-control-height) - 4px);
163
162
  padding: 4px 32px 4px 6px;
164
163
  border-radius: var(--sprout-radius-control);
165
164
  color: var(--sprout-text);
@@ -245,9 +244,6 @@
245
244
  .sprout-select-item {
246
245
  min-height: 2.75rem;
247
246
  }
248
- .sprout-select-trigger-calendar {
249
- min-width: 2.75rem;
250
- }
251
247
  }
252
248
 
253
249
  @media (forced-colors: active) {
@@ -90,6 +90,7 @@
90
90
  .sprout-sidebar-menu-action,
91
91
  .sprout-sidebar-trigger,
92
92
  .sprout-sidebar-close {
93
+ box-sizing: border-box;
93
94
  font: inherit;
94
95
  color: var(--sprout-text);
95
96
  background: transparent;
@@ -104,8 +105,8 @@
104
105
  gap: 10px;
105
106
  min-width: 0;
106
107
  width: 100%;
107
- min-height: 34px;
108
- padding: 7px 10px;
108
+ min-height: var(--sprout-control-height);
109
+ padding: 6px 10px;
109
110
  font-size: var(--sprout-text-sm);
110
111
  font-weight: 450;
111
112
  line-height: 20px;
@@ -169,9 +170,9 @@
169
170
  place-items: center;
170
171
  position: absolute;
171
172
  inset-inline-end: 4px;
172
- top: 3px;
173
- width: 28px;
174
- height: 28px;
173
+ top: 4px;
174
+ width: calc(var(--sprout-control-height) - 8px);
175
+ height: calc(var(--sprout-control-height) - 8px);
175
176
  }
176
177
  .sprout-sidebar-menu-item:has(.sprout-sidebar-menu-action) > .sprout-sidebar-menu-button,
177
178
  .sprout-sidebar-section-heading > .sprout-sidebar-menu-button {
@@ -192,9 +193,9 @@
192
193
  border-left: 1px solid var(--sprout-line);
193
194
  }
194
195
  .sprout-sidebar-sub-button {
195
- min-height: 30px;
196
- font-size: 12px;
197
- padding-block: 5px;
196
+ min-height: calc(var(--sprout-control-height) - 4px);
197
+ font-size: var(--sprout-text-xs);
198
+ line-height: 16px;
198
199
  }
199
200
  .sprout-sidebar-section-content {
200
201
  height: var(--collapsible-panel-height);
@@ -220,17 +221,18 @@
220
221
  align-items: center;
221
222
  justify-content: center;
222
223
  gap: 8px;
223
- min-width: 34px;
224
- min-height: 34px;
225
- padding: 7px;
224
+ min-width: var(--sprout-control-height);
225
+ min-height: var(--sprout-control-height);
226
+ padding: 6px;
226
227
  font-size: var(--sprout-text-xs);
227
228
  }
228
229
  .sprout-sidebar-skeleton {
230
+ box-sizing: border-box;
229
231
  display: flex;
230
232
  align-items: center;
231
233
  gap: 10px;
232
- min-height: 34px;
233
- padding: 7px 10px;
234
+ min-height: var(--sprout-control-height);
235
+ padding: 6px 10px;
234
236
  }
235
237
  .sprout-sidebar-skeleton span {
236
238
  display: block;
@@ -130,10 +130,10 @@
130
130
  font-weight: 500;
131
131
  text-overflow: ellipsis;
132
132
  }
133
- .sprout-state-sample-cell[data-size='wide'] {
133
+ .sprout-state-sample-cell[data-size='lg'] {
134
134
  flex: 1.6 1 0%;
135
135
  }
136
- .sprout-state-sample-cell[data-size='narrow'] {
136
+ .sprout-state-sample-cell[data-size='sm'] {
137
137
  flex: none;
138
138
  width: 6rem;
139
139
  }
@@ -263,11 +263,18 @@
263
263
  cursor: grab;
264
264
  touch-action: none;
265
265
  }
266
- .sprout-table-handle + .sprout-button-size-column-header {
267
- margin-inline-start: 0;
266
+ .sprout-button.sprout-table-sort {
267
+ margin-inline-start: -8px;
268
+ padding: 0 8px;
269
+ font-size: var(--sprout-text-sm);
270
+ line-height: 20px;
271
+ }
272
+ .sprout-button.sprout-table-sort-end {
273
+ flex-direction: row-reverse;
274
+ margin-inline: 0 -8px;
268
275
  }
269
- .sprout-table-handle + .sprout-button-size-column-header-end {
270
- margin-inline-end: 0;
276
+ .sprout-table-handle + .sprout-button.sprout-table-sort {
277
+ margin-inline: 0;
271
278
  }
272
279
  .sprout-table-handle:disabled {
273
280
  cursor: not-allowed;
@@ -17,7 +17,7 @@
17
17
  justify-content: center;
18
18
  box-sizing: border-box;
19
19
  width: fit-content;
20
- height: 32px;
20
+ height: var(--sprout-control-height);
21
21
  padding: 3px;
22
22
  border-radius: calc(var(--sprout-radius-control) + 2px);
23
23
  color: var(--sprout-muted);
@@ -29,8 +29,6 @@
29
29
  }
30
30
  .sprout-tabs-list-default {
31
31
  gap: 2px;
32
- height: 36px;
33
- padding: 4px;
34
32
  border-radius: calc(var(--sprout-radius-control) + 4px);
35
33
  background: var(--sprout-secondary);
36
34
  }
@@ -23,8 +23,8 @@
23
23
  justify-content: center;
24
24
  gap: 6px;
25
25
  box-sizing: border-box;
26
- height: 32px;
27
- min-width: 32px;
26
+ height: var(--sprout-control-height);
27
+ min-width: var(--sprout-control-height);
28
28
  margin: 0;
29
29
  padding: 0 10px;
30
30
  border: 1px solid transparent;
@@ -86,8 +86,8 @@
86
86
  .sprout-toggle-group-item-size-sm {
87
87
  --sprout-toggle-group-icon: 0.875rem;
88
88
  gap: 4px;
89
- height: 28px;
90
- min-width: 28px;
89
+ height: calc(var(--sprout-control-height) - 4px);
90
+ min-width: calc(var(--sprout-control-height) - 4px);
91
91
  font-size: var(--sprout-text-xs);
92
92
  line-height: 16px;
93
93
  }
@@ -98,8 +98,8 @@
98
98
  padding-inline-end: 6px;
99
99
  }
100
100
  .sprout-toggle-group-item-size-lg {
101
- height: 36px;
102
- min-width: 36px;
101
+ height: calc(var(--sprout-control-height) + 4px);
102
+ min-width: calc(var(--sprout-control-height) + 4px);
103
103
  }
104
104
 
105
105
  /* spacing={0} joins items into one segmented control. */
@@ -8,8 +8,8 @@
8
8
  justify-content: center;
9
9
  gap: 4px;
10
10
  box-sizing: border-box;
11
- height: 32px;
12
- min-width: 32px;
11
+ height: var(--sprout-control-height);
12
+ min-width: var(--sprout-control-height);
13
13
  margin: 0;
14
14
  padding: 0 10px;
15
15
  border: 1px solid transparent;
@@ -81,8 +81,8 @@
81
81
 
82
82
  .sprout-toggle-size-sm {
83
83
  --sprout-toggle-icon: 0.875rem;
84
- height: 28px;
85
- min-width: 28px;
84
+ height: calc(var(--sprout-control-height) - 4px);
85
+ min-width: calc(var(--sprout-control-height) - 4px);
86
86
  font-size: var(--sprout-text-xs);
87
87
  line-height: 16px;
88
88
  }
@@ -93,8 +93,8 @@
93
93
  padding-inline-end: 6px;
94
94
  }
95
95
  .sprout-toggle-size-lg {
96
- height: 36px;
97
- min-width: 36px;
96
+ height: calc(var(--sprout-control-height) + 4px);
97
+ min-width: calc(var(--sprout-control-height) + 4px);
98
98
  }
99
99
 
100
100
  @media (prefers-reduced-motion: no-preference) {
@@ -22,7 +22,7 @@
22
22
  gap: 2px;
23
23
  width: auto;
24
24
  max-width: 100%;
25
- height: 40px;
25
+ height: calc(var(--sprout-control-height) + 8px);
26
26
  padding: 0 2px;
27
27
  overflow-x: auto;
28
28
  overflow-y: hidden;
@@ -58,7 +58,7 @@
58
58
  .sprout-view-switcher-tab.sprout-tabs-trigger {
59
59
  flex: none;
60
60
  gap: 6px;
61
- height: 30px;
61
+ height: calc(var(--sprout-control-height) - 4px);
62
62
  padding: 0 8px;
63
63
  border: 0;
64
64
  color: var(--sprout-muted);
@@ -121,6 +121,24 @@
121
121
  opacity: 1;
122
122
  }
123
123
  }
124
+ /* With a pointer, the close button floats over the tab end instead of taking space, so gaps stay even. */
125
+ @media (hover: hover) {
126
+ .sprout-view-switcher-tab[data-closable] {
127
+ padding-inline-end: 8px;
128
+ }
129
+ .sprout-view-switcher-close {
130
+ position: absolute;
131
+ inset-inline-end: 4px;
132
+ top: 50%;
133
+ translate: 0 -50%;
134
+ }
135
+ .sprout-view-switcher-tab[data-closable]:is(:hover, :focus-visible) .sprout-view-switcher-label {
136
+ mask-image: linear-gradient(to left, transparent 14px, #000 24px);
137
+ }
138
+ .sprout-view-switcher-tab[data-closable]:is(:hover, :focus-visible) .sprout-view-switcher-label:dir(rtl) {
139
+ mask-image: linear-gradient(to right, transparent 14px, #000 24px);
140
+ }
141
+ }
124
142
 
125
143
  .sprout-view-switcher-indicator {
126
144
  position: absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tulipfarm/sprout",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Considered React controls. Built with Base UI and Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,6 +40,10 @@
40
40
  "types": "./dist/components/agent-fanout.d.ts",
41
41
  "import": "./dist/components/agent-fanout.js"
42
42
  },
43
+ "./agent-avatar": {
44
+ "types": "./dist/components/agent-avatar.d.ts",
45
+ "import": "./dist/components/agent-avatar.js"
46
+ },
43
47
  "./alert": {
44
48
  "types": "./dist/components/alert.d.ts",
45
49
  "import": "./dist/components/alert.js"