@womp/kookie-ui 0.11.0 → 0.12.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.
- package/components.css +182 -192
- package/dist/cjs/components/chatbar.d.ts +26 -2
- package/dist/cjs/components/chatbar.d.ts.map +1 -1
- package/dist/cjs/components/chatbar.js +2 -2
- package/dist/cjs/components/chatbar.js.map +3 -3
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/chunk-EGMUQQRW.js +2 -0
- package/dist/esm/chunk-EGMUQQRW.js.map +7 -0
- package/dist/esm/components/chatbar.d.ts +26 -2
- package/dist/esm/components/chatbar.d.ts.map +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/src/components/chatbar.css +75 -40
- package/src/components/chatbar.tsx +126 -49
- package/styles.css +182 -192
- package/dist/esm/chunk-ENLFKWYV.js +0 -2
- package/dist/esm/chunk-ENLFKWYV.js.map +0 -7
package/styles.css
CHANGED
|
@@ -27049,7 +27049,9 @@
|
|
|
27049
27049
|
min-width: 0;
|
|
27050
27050
|
}
|
|
27051
27051
|
.rt-ChatbarRoot {
|
|
27052
|
-
--chatbar-
|
|
27052
|
+
--chatbar-item-lead: var(--space-5);
|
|
27053
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27054
|
+
--chatbar-item-padding: var(--space-1);
|
|
27053
27055
|
display: -webkit-box;
|
|
27054
27056
|
display: -ms-flexbox;
|
|
27055
27057
|
display: flex;
|
|
@@ -27152,13 +27154,40 @@
|
|
|
27152
27154
|
.rt-ChatbarScrollArea :where(.rt-ScrollAreaScrollbar[data-orientation='horizontal']) {
|
|
27153
27155
|
--scrollarea-scrollbar-size: 3px;
|
|
27154
27156
|
}
|
|
27155
|
-
.rt-
|
|
27156
|
-
|
|
27157
|
-
|
|
27158
|
-
|
|
27157
|
+
.rt-ChatbarAttachment {
|
|
27158
|
+
position: relative;
|
|
27159
|
+
}
|
|
27160
|
+
.rt-ChatbarItem {
|
|
27161
|
+
display: -webkit-inline-box;
|
|
27162
|
+
display: -ms-inline-flexbox;
|
|
27163
|
+
display: inline-flex;
|
|
27164
|
+
-webkit-box-align: center;
|
|
27165
|
+
-ms-flex-align: center;
|
|
27166
|
+
align-items: center;
|
|
27167
|
+
gap: var(--space-2);
|
|
27159
27168
|
-ms-flex-negative: 0;
|
|
27160
27169
|
flex-shrink: 0;
|
|
27161
|
-
|
|
27170
|
+
-webkit-box-sizing: border-box;
|
|
27171
|
+
box-sizing: border-box;
|
|
27172
|
+
max-width: 240px;
|
|
27173
|
+
padding: var(--chatbar-item-padding);
|
|
27174
|
+
padding-right: calc(var(--chatbar-item-padding) + var(--space-1));
|
|
27175
|
+
border: 1px solid var(--gray-a5);
|
|
27176
|
+
border-radius: calc(var(--chatbar-item-lead-radius) + var(--chatbar-item-padding));
|
|
27177
|
+
background-color: var(--color-panel-solid);
|
|
27178
|
+
-webkit-box-shadow: 0 1px 2px var(--gray-a3);
|
|
27179
|
+
box-shadow: 0 1px 2px var(--gray-a3);
|
|
27180
|
+
color: var(--gray-12);
|
|
27181
|
+
}
|
|
27182
|
+
.rt-ChatbarItem:where([data-status='error']) {
|
|
27183
|
+
border-color: var(--red-a7);
|
|
27184
|
+
}
|
|
27185
|
+
.rt-ChatbarItemLead {
|
|
27186
|
+
height: var(--chatbar-item-lead);
|
|
27187
|
+
width: var(--chatbar-item-lead);
|
|
27188
|
+
-ms-flex-negative: 0;
|
|
27189
|
+
flex-shrink: 0;
|
|
27190
|
+
border-radius: var(--chatbar-item-lead-radius);
|
|
27162
27191
|
overflow: hidden;
|
|
27163
27192
|
display: -webkit-inline-box;
|
|
27164
27193
|
display: -ms-inline-flexbox;
|
|
@@ -27169,90 +27198,187 @@
|
|
|
27169
27198
|
-webkit-box-pack: center;
|
|
27170
27199
|
-ms-flex-pack: center;
|
|
27171
27200
|
justify-content: center;
|
|
27201
|
+
background: var(--accent-a3);
|
|
27202
|
+
color: var(--accent-11);
|
|
27203
|
+
}
|
|
27204
|
+
.rt-ChatbarItemLead :where(svg) {
|
|
27205
|
+
width: calc(var(--chatbar-item-lead) * 0.6);
|
|
27206
|
+
height: calc(var(--chatbar-item-lead) * 0.6);
|
|
27207
|
+
}
|
|
27208
|
+
.rt-ChatbarItemLead:where([data-kind='image']) {
|
|
27172
27209
|
background: var(--gray-a3);
|
|
27173
27210
|
}
|
|
27211
|
+
.rt-ChatbarAttachment .rt-ChatbarItemLead:where([data-kind='icon']) {
|
|
27212
|
+
background: var(--gray-a3);
|
|
27213
|
+
color: var(--gray-11);
|
|
27214
|
+
}
|
|
27174
27215
|
.rt-ChatbarAttachmentImage {
|
|
27216
|
+
width: 100%;
|
|
27175
27217
|
height: 100%;
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
object-fit: contain;
|
|
27218
|
+
-o-object-fit: cover;
|
|
27219
|
+
object-fit: cover;
|
|
27179
27220
|
max-width: none;
|
|
27180
27221
|
}
|
|
27181
|
-
.rt-
|
|
27182
|
-
|
|
27183
|
-
background-color: var(--gray-1);
|
|
27184
|
-
border-radius: var(--radius-1);
|
|
27185
|
-
}
|
|
27186
|
-
.rt-ChatbarAttachment:where([data-kind='file']) {
|
|
27187
|
-
max-width: 200px;
|
|
27222
|
+
.rt-ChatbarItemLabel {
|
|
27223
|
+
min-width: 0;
|
|
27188
27224
|
}
|
|
27189
|
-
.rt-
|
|
27190
|
-
|
|
27191
|
-
|
|
27192
|
-
|
|
27225
|
+
.rt-ChatbarItemRemove {
|
|
27226
|
+
-ms-flex-negative: 0;
|
|
27227
|
+
flex-shrink: 0;
|
|
27228
|
+
margin-left: calc(var(--space-1) * -1);
|
|
27193
27229
|
}
|
|
27194
|
-
.rt-ChatbarRoot:where(.rt-r-size-1)
|
|
27195
|
-
|
|
27230
|
+
.rt-ChatbarRoot:where(.rt-r-size-1) {
|
|
27231
|
+
--chatbar-item-lead: var(--space-4);
|
|
27232
|
+
--chatbar-item-lead-radius: var(--radius-1);
|
|
27233
|
+
--chatbar-item-padding: var(--space-1);
|
|
27234
|
+
font-size: var(--font-size-1);
|
|
27235
|
+
line-height: var(--line-height-1);
|
|
27236
|
+
--chatbar-attachments-radius: var(--radius-1);
|
|
27196
27237
|
}
|
|
27197
|
-
.rt-ChatbarRoot:where(.rt-r-size-2)
|
|
27198
|
-
|
|
27238
|
+
.rt-ChatbarRoot:where(.rt-r-size-2) {
|
|
27239
|
+
--chatbar-item-lead: var(--space-5);
|
|
27240
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27241
|
+
--chatbar-item-padding: var(--space-1);
|
|
27242
|
+
font-size: var(--font-size-2);
|
|
27243
|
+
line-height: var(--line-height-2);
|
|
27244
|
+
--chatbar-attachments-radius: var(--radius-2);
|
|
27199
27245
|
}
|
|
27200
|
-
.rt-ChatbarRoot:where(.rt-r-size-3)
|
|
27201
|
-
|
|
27246
|
+
.rt-ChatbarRoot:where(.rt-r-size-3) {
|
|
27247
|
+
--chatbar-item-lead: calc(var(--space-5) + var(--space-1));
|
|
27248
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27249
|
+
--chatbar-item-padding: calc(var(--space-1) * 1.5);
|
|
27250
|
+
font-size: var(--font-size-3);
|
|
27251
|
+
line-height: var(--line-height-3);
|
|
27252
|
+
--chatbar-attachments-radius: var(--radius-3);
|
|
27202
27253
|
}
|
|
27203
27254
|
@media (min-width: 520px) {
|
|
27204
|
-
.rt-ChatbarRoot:where(.xs\:rt-r-size-1)
|
|
27205
|
-
|
|
27255
|
+
.rt-ChatbarRoot:where(.xs\:rt-r-size-1) {
|
|
27256
|
+
--chatbar-item-lead: var(--space-4);
|
|
27257
|
+
--chatbar-item-lead-radius: var(--radius-1);
|
|
27258
|
+
--chatbar-item-padding: var(--space-1);
|
|
27259
|
+
font-size: var(--font-size-1);
|
|
27260
|
+
line-height: var(--line-height-1);
|
|
27261
|
+
--chatbar-attachments-radius: var(--radius-1);
|
|
27206
27262
|
}
|
|
27207
|
-
.rt-ChatbarRoot:where(.xs\:rt-r-size-2)
|
|
27208
|
-
|
|
27263
|
+
.rt-ChatbarRoot:where(.xs\:rt-r-size-2) {
|
|
27264
|
+
--chatbar-item-lead: var(--space-5);
|
|
27265
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27266
|
+
--chatbar-item-padding: var(--space-1);
|
|
27267
|
+
font-size: var(--font-size-2);
|
|
27268
|
+
line-height: var(--line-height-2);
|
|
27269
|
+
--chatbar-attachments-radius: var(--radius-2);
|
|
27209
27270
|
}
|
|
27210
|
-
.rt-ChatbarRoot:where(.xs\:rt-r-size-3)
|
|
27211
|
-
|
|
27271
|
+
.rt-ChatbarRoot:where(.xs\:rt-r-size-3) {
|
|
27272
|
+
--chatbar-item-lead: calc(var(--space-5) + var(--space-1));
|
|
27273
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27274
|
+
--chatbar-item-padding: calc(var(--space-1) * 1.5);
|
|
27275
|
+
font-size: var(--font-size-3);
|
|
27276
|
+
line-height: var(--line-height-3);
|
|
27277
|
+
--chatbar-attachments-radius: var(--radius-3);
|
|
27212
27278
|
}
|
|
27213
27279
|
}
|
|
27214
27280
|
@media (min-width: 768px) {
|
|
27215
|
-
.rt-ChatbarRoot:where(.sm\:rt-r-size-1)
|
|
27216
|
-
|
|
27281
|
+
.rt-ChatbarRoot:where(.sm\:rt-r-size-1) {
|
|
27282
|
+
--chatbar-item-lead: var(--space-4);
|
|
27283
|
+
--chatbar-item-lead-radius: var(--radius-1);
|
|
27284
|
+
--chatbar-item-padding: var(--space-1);
|
|
27285
|
+
font-size: var(--font-size-1);
|
|
27286
|
+
line-height: var(--line-height-1);
|
|
27287
|
+
--chatbar-attachments-radius: var(--radius-1);
|
|
27217
27288
|
}
|
|
27218
|
-
.rt-ChatbarRoot:where(.sm\:rt-r-size-2)
|
|
27219
|
-
|
|
27289
|
+
.rt-ChatbarRoot:where(.sm\:rt-r-size-2) {
|
|
27290
|
+
--chatbar-item-lead: var(--space-5);
|
|
27291
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27292
|
+
--chatbar-item-padding: var(--space-1);
|
|
27293
|
+
font-size: var(--font-size-2);
|
|
27294
|
+
line-height: var(--line-height-2);
|
|
27295
|
+
--chatbar-attachments-radius: var(--radius-2);
|
|
27220
27296
|
}
|
|
27221
|
-
.rt-ChatbarRoot:where(.sm\:rt-r-size-3)
|
|
27222
|
-
|
|
27297
|
+
.rt-ChatbarRoot:where(.sm\:rt-r-size-3) {
|
|
27298
|
+
--chatbar-item-lead: calc(var(--space-5) + var(--space-1));
|
|
27299
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27300
|
+
--chatbar-item-padding: calc(var(--space-1) * 1.5);
|
|
27301
|
+
font-size: var(--font-size-3);
|
|
27302
|
+
line-height: var(--line-height-3);
|
|
27303
|
+
--chatbar-attachments-radius: var(--radius-3);
|
|
27223
27304
|
}
|
|
27224
27305
|
}
|
|
27225
27306
|
@media (min-width: 1024px) {
|
|
27226
|
-
.rt-ChatbarRoot:where(.md\:rt-r-size-1)
|
|
27227
|
-
|
|
27307
|
+
.rt-ChatbarRoot:where(.md\:rt-r-size-1) {
|
|
27308
|
+
--chatbar-item-lead: var(--space-4);
|
|
27309
|
+
--chatbar-item-lead-radius: var(--radius-1);
|
|
27310
|
+
--chatbar-item-padding: var(--space-1);
|
|
27311
|
+
font-size: var(--font-size-1);
|
|
27312
|
+
line-height: var(--line-height-1);
|
|
27313
|
+
--chatbar-attachments-radius: var(--radius-1);
|
|
27228
27314
|
}
|
|
27229
|
-
.rt-ChatbarRoot:where(.md\:rt-r-size-2)
|
|
27230
|
-
|
|
27315
|
+
.rt-ChatbarRoot:where(.md\:rt-r-size-2) {
|
|
27316
|
+
--chatbar-item-lead: var(--space-5);
|
|
27317
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27318
|
+
--chatbar-item-padding: var(--space-1);
|
|
27319
|
+
font-size: var(--font-size-2);
|
|
27320
|
+
line-height: var(--line-height-2);
|
|
27321
|
+
--chatbar-attachments-radius: var(--radius-2);
|
|
27231
27322
|
}
|
|
27232
|
-
.rt-ChatbarRoot:where(.md\:rt-r-size-3)
|
|
27233
|
-
|
|
27323
|
+
.rt-ChatbarRoot:where(.md\:rt-r-size-3) {
|
|
27324
|
+
--chatbar-item-lead: calc(var(--space-5) + var(--space-1));
|
|
27325
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27326
|
+
--chatbar-item-padding: calc(var(--space-1) * 1.5);
|
|
27327
|
+
font-size: var(--font-size-3);
|
|
27328
|
+
line-height: var(--line-height-3);
|
|
27329
|
+
--chatbar-attachments-radius: var(--radius-3);
|
|
27234
27330
|
}
|
|
27235
27331
|
}
|
|
27236
27332
|
@media (min-width: 1280px) {
|
|
27237
|
-
.rt-ChatbarRoot:where(.lg\:rt-r-size-1)
|
|
27238
|
-
|
|
27333
|
+
.rt-ChatbarRoot:where(.lg\:rt-r-size-1) {
|
|
27334
|
+
--chatbar-item-lead: var(--space-4);
|
|
27335
|
+
--chatbar-item-lead-radius: var(--radius-1);
|
|
27336
|
+
--chatbar-item-padding: var(--space-1);
|
|
27337
|
+
font-size: var(--font-size-1);
|
|
27338
|
+
line-height: var(--line-height-1);
|
|
27339
|
+
--chatbar-attachments-radius: var(--radius-1);
|
|
27239
27340
|
}
|
|
27240
|
-
.rt-ChatbarRoot:where(.lg\:rt-r-size-2)
|
|
27241
|
-
|
|
27341
|
+
.rt-ChatbarRoot:where(.lg\:rt-r-size-2) {
|
|
27342
|
+
--chatbar-item-lead: var(--space-5);
|
|
27343
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27344
|
+
--chatbar-item-padding: var(--space-1);
|
|
27345
|
+
font-size: var(--font-size-2);
|
|
27346
|
+
line-height: var(--line-height-2);
|
|
27347
|
+
--chatbar-attachments-radius: var(--radius-2);
|
|
27242
27348
|
}
|
|
27243
|
-
.rt-ChatbarRoot:where(.lg\:rt-r-size-3)
|
|
27244
|
-
|
|
27349
|
+
.rt-ChatbarRoot:where(.lg\:rt-r-size-3) {
|
|
27350
|
+
--chatbar-item-lead: calc(var(--space-5) + var(--space-1));
|
|
27351
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27352
|
+
--chatbar-item-padding: calc(var(--space-1) * 1.5);
|
|
27353
|
+
font-size: var(--font-size-3);
|
|
27354
|
+
line-height: var(--line-height-3);
|
|
27355
|
+
--chatbar-attachments-radius: var(--radius-3);
|
|
27245
27356
|
}
|
|
27246
27357
|
}
|
|
27247
27358
|
@media (min-width: 1640px) {
|
|
27248
|
-
.rt-ChatbarRoot:where(.xl\:rt-r-size-1)
|
|
27249
|
-
|
|
27359
|
+
.rt-ChatbarRoot:where(.xl\:rt-r-size-1) {
|
|
27360
|
+
--chatbar-item-lead: var(--space-4);
|
|
27361
|
+
--chatbar-item-lead-radius: var(--radius-1);
|
|
27362
|
+
--chatbar-item-padding: var(--space-1);
|
|
27363
|
+
font-size: var(--font-size-1);
|
|
27364
|
+
line-height: var(--line-height-1);
|
|
27365
|
+
--chatbar-attachments-radius: var(--radius-1);
|
|
27250
27366
|
}
|
|
27251
|
-
.rt-ChatbarRoot:where(.xl\:rt-r-size-2)
|
|
27252
|
-
|
|
27367
|
+
.rt-ChatbarRoot:where(.xl\:rt-r-size-2) {
|
|
27368
|
+
--chatbar-item-lead: var(--space-5);
|
|
27369
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27370
|
+
--chatbar-item-padding: var(--space-1);
|
|
27371
|
+
font-size: var(--font-size-2);
|
|
27372
|
+
line-height: var(--line-height-2);
|
|
27373
|
+
--chatbar-attachments-radius: var(--radius-2);
|
|
27253
27374
|
}
|
|
27254
|
-
.rt-ChatbarRoot:where(.xl\:rt-r-size-3)
|
|
27255
|
-
|
|
27375
|
+
.rt-ChatbarRoot:where(.xl\:rt-r-size-3) {
|
|
27376
|
+
--chatbar-item-lead: calc(var(--space-5) + var(--space-1));
|
|
27377
|
+
--chatbar-item-lead-radius: var(--radius-2);
|
|
27378
|
+
--chatbar-item-padding: calc(var(--space-1) * 1.5);
|
|
27379
|
+
font-size: var(--font-size-3);
|
|
27380
|
+
line-height: var(--line-height-3);
|
|
27381
|
+
--chatbar-attachments-radius: var(--radius-3);
|
|
27256
27382
|
}
|
|
27257
27383
|
}
|
|
27258
27384
|
.rt-ChatbarBox {
|
|
@@ -27806,142 +27932,6 @@
|
|
|
27806
27932
|
flex-shrink: 0;
|
|
27807
27933
|
margin-left: auto;
|
|
27808
27934
|
}
|
|
27809
|
-
.rt-ChatbarRoot:where(.rt-r-size-1) {
|
|
27810
|
-
font-size: var(--font-size-1);
|
|
27811
|
-
line-height: var(--line-height-1);
|
|
27812
|
-
--chatbar-attachment-thumb: var(--space-8);
|
|
27813
|
-
--chatbar-remove-offset: calc(var(--space-1) * 0.5);
|
|
27814
|
-
--chatbar-attachments-radius: var(--radius-1);
|
|
27815
|
-
}
|
|
27816
|
-
.rt-ChatbarRoot:where(.rt-r-size-2) {
|
|
27817
|
-
font-size: var(--font-size-2);
|
|
27818
|
-
line-height: var(--line-height-2);
|
|
27819
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27820
|
-
--chatbar-remove-offset: var(--space-1);
|
|
27821
|
-
--chatbar-attachments-radius: var(--radius-2);
|
|
27822
|
-
}
|
|
27823
|
-
.rt-ChatbarRoot:where(.rt-r-size-3) {
|
|
27824
|
-
font-size: var(--font-size-3);
|
|
27825
|
-
line-height: var(--line-height-3);
|
|
27826
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27827
|
-
--chatbar-remove-offset: var(--space-2);
|
|
27828
|
-
--chatbar-attachments-radius: var(--radius-3);
|
|
27829
|
-
}
|
|
27830
|
-
@media (min-width: 520px) {
|
|
27831
|
-
.rt-ChatbarRoot:where(.xs\:rt-r-size-1) {
|
|
27832
|
-
font-size: var(--font-size-1);
|
|
27833
|
-
line-height: var(--line-height-1);
|
|
27834
|
-
--chatbar-attachment-thumb: var(--space-8);
|
|
27835
|
-
--chatbar-remove-offset: calc(var(--space-1) * 0.5);
|
|
27836
|
-
--chatbar-attachments-radius: var(--radius-1);
|
|
27837
|
-
}
|
|
27838
|
-
.rt-ChatbarRoot:where(.xs\:rt-r-size-2) {
|
|
27839
|
-
font-size: var(--font-size-2);
|
|
27840
|
-
line-height: var(--line-height-2);
|
|
27841
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27842
|
-
--chatbar-remove-offset: var(--space-1);
|
|
27843
|
-
--chatbar-attachments-radius: var(--radius-2);
|
|
27844
|
-
}
|
|
27845
|
-
.rt-ChatbarRoot:where(.xs\:rt-r-size-3) {
|
|
27846
|
-
font-size: var(--font-size-3);
|
|
27847
|
-
line-height: var(--line-height-3);
|
|
27848
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27849
|
-
--chatbar-remove-offset: var(--space-2);
|
|
27850
|
-
--chatbar-attachments-radius: var(--radius-3);
|
|
27851
|
-
}
|
|
27852
|
-
}
|
|
27853
|
-
@media (min-width: 768px) {
|
|
27854
|
-
.rt-ChatbarRoot:where(.sm\:rt-r-size-1) {
|
|
27855
|
-
font-size: var(--font-size-1);
|
|
27856
|
-
line-height: var(--line-height-1);
|
|
27857
|
-
--chatbar-attachment-thumb: var(--space-8);
|
|
27858
|
-
--chatbar-remove-offset: calc(var(--space-1) * 0.5);
|
|
27859
|
-
--chatbar-attachments-radius: var(--radius-1);
|
|
27860
|
-
}
|
|
27861
|
-
.rt-ChatbarRoot:where(.sm\:rt-r-size-2) {
|
|
27862
|
-
font-size: var(--font-size-2);
|
|
27863
|
-
line-height: var(--line-height-2);
|
|
27864
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27865
|
-
--chatbar-remove-offset: var(--space-1);
|
|
27866
|
-
--chatbar-attachments-radius: var(--radius-2);
|
|
27867
|
-
}
|
|
27868
|
-
.rt-ChatbarRoot:where(.sm\:rt-r-size-3) {
|
|
27869
|
-
font-size: var(--font-size-3);
|
|
27870
|
-
line-height: var(--line-height-3);
|
|
27871
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27872
|
-
--chatbar-remove-offset: var(--space-2);
|
|
27873
|
-
--chatbar-attachments-radius: var(--radius-3);
|
|
27874
|
-
}
|
|
27875
|
-
}
|
|
27876
|
-
@media (min-width: 1024px) {
|
|
27877
|
-
.rt-ChatbarRoot:where(.md\:rt-r-size-1) {
|
|
27878
|
-
font-size: var(--font-size-1);
|
|
27879
|
-
line-height: var(--line-height-1);
|
|
27880
|
-
--chatbar-attachment-thumb: var(--space-8);
|
|
27881
|
-
--chatbar-remove-offset: calc(var(--space-1) * 0.5);
|
|
27882
|
-
--chatbar-attachments-radius: var(--radius-1);
|
|
27883
|
-
}
|
|
27884
|
-
.rt-ChatbarRoot:where(.md\:rt-r-size-2) {
|
|
27885
|
-
font-size: var(--font-size-2);
|
|
27886
|
-
line-height: var(--line-height-2);
|
|
27887
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27888
|
-
--chatbar-remove-offset: var(--space-1);
|
|
27889
|
-
--chatbar-attachments-radius: var(--radius-2);
|
|
27890
|
-
}
|
|
27891
|
-
.rt-ChatbarRoot:where(.md\:rt-r-size-3) {
|
|
27892
|
-
font-size: var(--font-size-3);
|
|
27893
|
-
line-height: var(--line-height-3);
|
|
27894
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27895
|
-
--chatbar-remove-offset: var(--space-2);
|
|
27896
|
-
--chatbar-attachments-radius: var(--radius-3);
|
|
27897
|
-
}
|
|
27898
|
-
}
|
|
27899
|
-
@media (min-width: 1280px) {
|
|
27900
|
-
.rt-ChatbarRoot:where(.lg\:rt-r-size-1) {
|
|
27901
|
-
font-size: var(--font-size-1);
|
|
27902
|
-
line-height: var(--line-height-1);
|
|
27903
|
-
--chatbar-attachment-thumb: var(--space-8);
|
|
27904
|
-
--chatbar-remove-offset: calc(var(--space-1) * 0.5);
|
|
27905
|
-
--chatbar-attachments-radius: var(--radius-1);
|
|
27906
|
-
}
|
|
27907
|
-
.rt-ChatbarRoot:where(.lg\:rt-r-size-2) {
|
|
27908
|
-
font-size: var(--font-size-2);
|
|
27909
|
-
line-height: var(--line-height-2);
|
|
27910
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27911
|
-
--chatbar-remove-offset: var(--space-1);
|
|
27912
|
-
--chatbar-attachments-radius: var(--radius-2);
|
|
27913
|
-
}
|
|
27914
|
-
.rt-ChatbarRoot:where(.lg\:rt-r-size-3) {
|
|
27915
|
-
font-size: var(--font-size-3);
|
|
27916
|
-
line-height: var(--line-height-3);
|
|
27917
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27918
|
-
--chatbar-remove-offset: var(--space-2);
|
|
27919
|
-
--chatbar-attachments-radius: var(--radius-3);
|
|
27920
|
-
}
|
|
27921
|
-
}
|
|
27922
|
-
@media (min-width: 1640px) {
|
|
27923
|
-
.rt-ChatbarRoot:where(.xl\:rt-r-size-1) {
|
|
27924
|
-
font-size: var(--font-size-1);
|
|
27925
|
-
line-height: var(--line-height-1);
|
|
27926
|
-
--chatbar-attachment-thumb: var(--space-8);
|
|
27927
|
-
--chatbar-remove-offset: calc(var(--space-1) * 0.5);
|
|
27928
|
-
--chatbar-attachments-radius: var(--radius-1);
|
|
27929
|
-
}
|
|
27930
|
-
.rt-ChatbarRoot:where(.xl\:rt-r-size-2) {
|
|
27931
|
-
font-size: var(--font-size-2);
|
|
27932
|
-
line-height: var(--line-height-2);
|
|
27933
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27934
|
-
--chatbar-remove-offset: var(--space-1);
|
|
27935
|
-
--chatbar-attachments-radius: var(--radius-2);
|
|
27936
|
-
}
|
|
27937
|
-
.rt-ChatbarRoot:where(.xl\:rt-r-size-3) {
|
|
27938
|
-
font-size: var(--font-size-3);
|
|
27939
|
-
line-height: var(--line-height-3);
|
|
27940
|
-
--chatbar-attachment-thumb: var(--space-9);
|
|
27941
|
-
--chatbar-remove-offset: var(--space-2);
|
|
27942
|
-
--chatbar-attachments-radius: var(--radius-3);
|
|
27943
|
-
}
|
|
27944
|
-
}
|
|
27945
27935
|
.rt-ChatbarNotices {
|
|
27946
27936
|
display: -webkit-box;
|
|
27947
27937
|
display: -ms-flexbox;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as rt}from"./chunk-L5PID6BU.js";import{a as je}from"./chunk-ISOLUTZF.js";import{a as nt}from"./chunk-COWZAUZR.js";import{g as tt,j as at}from"./chunk-IX5HIHVI.js";import{a as me}from"./chunk-5WRCK4R7.js";import{a as et}from"./chunk-HF5WY5YE.js";import{a as Be}from"./chunk-AGAQC4HH.js";import{a as de}from"./chunk-FHOCUZDR.js";import{b as U}from"./chunk-FWB47YCH.js";import{a as Ot}from"./chunk-OS3FCYZY.js";var $t={};Ot($t,{AttachTrigger:()=>ft,Attachment:()=>Ue,AttachmentsRow:()=>ht,InlineEnd:()=>pt,InlineStart:()=>mt,Root:()=>ut,Row:()=>bt,RowEnd:()=>Ct,RowStart:()=>Rt,Send:()=>gt,Textarea:()=>dt});import*as e from"react";import L from"classnames";import{LazyMotion as Ft,MotionConfig as Ht,domAnimation as zt,m as he}from"motion/react";import{useComposedRefs as it}from"radix-ui/internal";import{useDropzone as It}from"react-dropzone";var Ve=typeof window<"u"?e.useLayoutEffect:e.useEffect;function ot(n,s){let{placeholder:r}=n;if(!r){s();return}n.placeholder="";try{s()}finally{n.placeholder=r}}var fe={layout:{type:"spring",visualDuration:.15,bounce:.1}},ct=e.createContext(null),$e=e.createContext(""),K=()=>{let n=e.useContext(ct);if(!n)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return n},pe=n=>Array.isArray(n)?n:typeof n=="string"?n.split(",").map(s=>s.trim()).filter(Boolean):[],Dt=(n,s)=>{if(s.length===0)return!0;let r=n.type.toLowerCase(),d=n.name.toLowerCase();for(let f of s){let i=f.toLowerCase();if(i.includes("/")){let[b,c]=i.split("/"),[C,p]=r.split("/");if(b==="*"||b===C&&(c==="*"||c===p))return!0}else if(i.startsWith(".")&&d.endsWith(i))return!0}return!1},Bt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,lt=(n,s)=>(s||"").toLowerCase().startsWith("image/")||Bt.test(n),We=n=>n.trim().length>0,st=(n,s)=>`${n} ${s}${n===1?"":"s"}`,jt=0,Vt=()=>`chatbar-attachment-${Date.now()}-${++jt}`,ut=e.forwardRef((n,s)=>{let{className:r,style:d,children:f,value:i,defaultValue:b="",onValueChange:c,open:C,defaultOpen:p=!1,onOpenChange:S,expandOn:A="both",minLines:h=3,maxLines:B=6,sendMode:H="whenDirty",disabled:l,readOnly:g,onSubmit:k,size:P="2",variant:E,color:M,radius:z,panelBackground:v,material:N,width:j,maxWidth:re,attachments:y,defaultAttachments:I,onAttachmentsChange:_,accept:be,multiple:F=!0,maxAttachments:G,maxFileSize:q,paste:D=!0,pasteAccept:O,clearOnSubmit:Y=!0,onAttachmentReject:Ee,dropzone:oe=!0,apiRef:Te,onBlurCapture:Re,notices:Ce,context:ge,...Le}=n,t=N||v,R=i!=null,[w,se]=e.useState(b),V=R?i:w,X=C!=null,[ke,ie]=e.useState(p),Q=X?C:ke,Z="attachments"in n,[Ke,vt]=e.useState(()=>I??[]),ce=e.useMemo(()=>Z?y??[]:Ke,[Z,y,Ke]),[_e,yt]=e.useState({text:"",id:0}),le=e.useCallback(a=>yt(o=>({text:a,id:o.id+1})),[]),Ge=e.useRef(null),xt=it(s,Ge),Me=e.useRef(null),Ne=e.useRef(null),ue=e.useRef(!1),ve=e.useRef(!1),ye=e.useRef(void 0),Oe=e.useRef(null),qe=pe(be).join(","),Fe=pe(O).join(","),He=e.useMemo(()=>pe(qe),[qe]),Pt=e.useMemo(()=>Fe?pe(Fe):He,[Fe,He]),Ye={value:V,attachments:ce,accepts:He,pasteAccepts:Pt,multiple:F,maxAttachments:G,maxFileSize:q,disabled:l,readOnly:g,expandOn:A,isValueControlled:R,isOpenControlled:X,isAttachmentsControlled:Z,onValueChange:c,onOpenChange:S,onAttachmentsChange:_,onAttachmentReject:Ee,onSubmit:k},x=e.useRef(Ye);x.current=Ye;let ze=e.useRef(null),W=e.useCallback(()=>ze.current??x.current.attachments,[]),ee=e.useCallback(a=>{x.current.isOpenControlled||ie(a),x.current.onOpenChange?.(a)},[]),xe=e.useCallback(a=>{x.current.isValueControlled||se(a),x.current.onValueChange?.(a)},[]),te=e.useCallback(a=>{ze.current=a,queueMicrotask(()=>{ze.current=null}),x.current.isAttachmentsControlled||vt(a),x.current.onAttachmentsChange?.(a)},[]),Pe=e.useRef(new Set),ae=e.useCallback((a,o,u=x.current.multiple)=>{let m=x.current;if(m.disabled||m.readOnly||a.length===0)return 0;let $=W(),J=[],ne=[],Mt=typeof m.maxAttachments=="number"?Math.max(m.maxAttachments-$.length,0):1/0,Nt=u?1/0:1;for(let T of a){if(J.length>=Mt||J.length>=Nt){ne.push({file:T,reason:"count"});continue}if(typeof m.maxFileSize=="number"&&T.size>m.maxFileSize){ne.push({file:T,reason:"size"});continue}if(!Dt(T,o)){ne.push({file:T,reason:"type"});continue}let De=lt(T.name,T.type)?URL.createObjectURL(T):void 0;De&&Pe.current.add(De),J.push({id:Vt(),name:T.name,size:T.size,type:T.type,file:T,url:De,status:"idle"})}let Se=[];return J.length>0&&(te($.concat(J)),m.expandOn!=="none"&&ee(!0),Se.push(`${st(J.length,"file")} attached.`)),ne.length>0&&(m.onAttachmentReject?.(ne),Se.push(`${st(ne.length,"file")} could not be attached.`)),Se.length>0&&le(Se.join(" ")),J.length},[W,te,ee,le]),Ae=e.useCallback(a=>ae(a,x.current.accepts),[ae]),Xe=e.useCallback(a=>ae(a,x.current.pasteAccepts),[ae]),Je=e.useCallback(a=>{let o=W(),u=o.find(m=>m.id===a);u&&(te(o.filter(m=>m.id!==a)),le(`Removed ${u.name}.`))},[W,te,le]),Qe=e.useCallback(a=>{let o=x.current;if(o.disabled||o.readOnly)return!1;let u=W();if(!We(o.value)&&u.length===0)return!1;let m={value:o.value,attachments:u};if(a&&o.onSubmit)for(let $ of u)$.url&&Pe.current.delete($.url);return o.onSubmit?.(m),a&&(xe(""),te([])),!0},[W,xe,te]);e.useEffect(()=>{let a=Pe.current;if(a.size===0)return;let o=new Set(ce.map(u=>u.url));for(let u of Array.from(a))o.has(u)||(URL.revokeObjectURL(u),a.delete(u))},[ce]),e.useEffect(()=>{let a=Pe.current;return()=>{if(!x.current.isAttachmentsControlled){for(let o of Array.from(a))URL.revokeObjectURL(o);a.clear()}}},[]);let we=e.useCallback(a=>{let o=x.current,u=Ne.current;if(clearTimeout(ye.current),ve.current=!1,!u||o.disabled||o.readOnly)return;let m=a?.accept!=null?pe(a.accept):o.accepts,$=a?.multiple??o.multiple;Oe.current={patterns:m,multiple:$},u.accept=m.join(","),u.multiple=$,ue.current=!0,u.click(),setTimeout(()=>{document.hasFocus()&&(ue.current=!1)},1e3)},[]),Ze=e.useCallback(()=>{ve.current=!0,clearTimeout(ye.current),ye.current=setTimeout(()=>{ve.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(ye.current),[]),e.useEffect(()=>{let a=Ne.current,o=()=>{ue.current=!1};return window.addEventListener("focus",o),a?.addEventListener("cancel",o),()=>{window.removeEventListener("focus",o),a?.removeEventListener("cancel",o)}},[]);let At=e.useCallback(a=>{let o=a.currentTarget,u=Array.from(o.files??[]),m=Oe.current;ae(u,m?.patterns??x.current.accepts,m?.multiple),ue.current=!1,Oe.current=null,o.value=""},[ae]),wt=e.useCallback(a=>{Re?.(a);let o=x.current,u=Ge.current;if(!u||o.expandOn==="none")return;let m=a.relatedTarget;m&&u.contains(m)||ue.current||ve.current||!We(o.value)&&W().length===0&&ee(!1)},[Re,ee,W]),St=e.useCallback(a=>{Ae(a)},[Ae]),{getRootProps:Et,isDragActive:Tt}=It({onDrop:St,onDragEnter:()=>le(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!oe||l||g}),Ie=oe&&Tt;e.useImperativeHandle(Te,()=>({focusTextarea:()=>Me.current?.focus({preventScroll:!0}),openFilePicker:()=>we()}),[we]);let Lt=e.useCallback(a=>{if(l||a.pointerType==="mouse"&&a.button!==0)return;let o=a.target;o instanceof Element&&o.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(a.preventDefault(),Me.current?.focus({preventScroll:!0}))},[l]),kt=e.useMemo(()=>({open:Q,setOpen:ee,setValue:xe,size:P,expandOn:A,minLines:h,maxLines:B,sendMode:H,disabled:l,readOnly:g,paste:D,clearOnSubmit:Y,multiple:F,textareaRef:Me,attachments:ce,removeAttachment:Je,submit:Qe,appendFiles:Ae,appendFilesFromPaste:Xe,openFilePicker:we,beginFilePickerPress:Ze}),[Q,ee,xe,P,A,h,B,H,l,g,D,Y,F,ce,Je,Qe,Ae,Xe,we,Ze]);return e.createElement(ct.Provider,{value:kt},e.createElement($e.Provider,{value:V},e.createElement(Ft,{features:zt},e.createElement(Ht,{reducedMotion:"user"},e.createElement("div",{...Le,ref:xt,className:L("rt-ChatbarRoot",`rt-r-size-${P}`,r),style:{position:"relative",width:j,maxWidth:re,...d},"data-state":Q?"open":"closed","data-disabled":l?"":void 0,"data-readonly":g?"":void 0,"data-drop-active":Ie?"":void 0,"data-accent-color":M,"data-radius":z,"data-panel-background":t,"data-material":t,onBlurCapture:wt},e.createElement("input",{ref:Ne,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:At}),Ce?e.createElement("div",{className:"rt-ChatbarNotices"},e.createElement(rt.Provider,{value:P},Ce)):null,e.createElement("div",{...oe?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement(he.div,{className:L("rt-ChatbarBox",`rt-variant-${E??"surface"}`),style:{position:"relative"},"data-accent-color":M,"data-radius":z,"data-panel-background":t,"data-material":t,layout:!0,transition:fe},e.createElement(he.div,{className:"rt-ChatbarGrid",layout:"position",transition:fe},f),Ie&&e.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"rt-ChatbarDropContent"},e.createElement(me,{emphasis:"medium",size:P,weight:"medium"},"Drop files here to attach"))))),ge?e.createElement(me,{as:"div",size:P==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},ge):null,e.createElement(Be,{role:"status","aria-live":"polite"},Ie?"Drop files here to attach.":e.createElement("span",{key:_e.id},_e.text)))))))});ut.displayName="Chatbar.Root";var dt=e.forwardRef((n,s)=>{let{className:r,style:d,asChild:f,onFocus:i,onChange:b,onPaste:c,onKeyDown:C,onCompositionStart:p,onCompositionEnd:S,submitOnEnter:A=!1,...h}=n,B=K(),H=e.useContext($e),{open:l,minLines:g,maxLines:k,expandOn:P,disabled:E,readOnly:M,setOpen:z,setValue:v,textareaRef:N,paste:j,appendFilesFromPaste:re,size:y,submit:I,clearOnSubmit:_}=B,be=it(s,N),F=e.useRef(0),G=e.useRef(0),q=e.useRef(!1),D=e.useRef({open:l,minLines:g,maxLines:k});Ve(()=>{D.current={open:l,minLines:g,maxLines:k}},[l,g,k]);let O=e.useCallback(()=>{let t=N.current;if(!t)return;let R=window.getComputedStyle(t);F.current=parseFloat(R.lineHeight)||20,G.current=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0)},[N]),Y=e.useCallback((t,R)=>{let{minLines:w,maxLines:se}=D.current,V=F.current,X=G.current,ke=Math.ceil((R?w:1)*V)+X,ie=Math.ceil((R?se:1)*V)+X,Q=Math.max(t.scrollHeight,ke);t.style.height=`${Math.min(Q,ie)}px`;let Z=Q>ie;t.style.overflowY=Z?"auto":"hidden",t.style.maxHeight=Z?`${ie}px`:"none"},[]);Ve(()=>{O()},[O,y]),Ve(()=>{let t=N.current;t&&(F.current===0&&O(),ot(t,()=>{t.style.height="auto";let R=l;if(!l&&(P==="overflow"||P==="both")){let w=Math.ceil(F.current)+G.current;t.scrollHeight>w+1&&(R=!0,z(!0))}Y(t,R)}))},[H,l,P,g,k,y,z,N,O,Y]),e.useEffect(()=>{let t=N.current;if(!t||typeof ResizeObserver>"u")return;let R=-1,w=new ResizeObserver(se=>{let V=se[0]?.contentRect.width??0;if(V===R)return;let X=R===-1;R=V,!X&&(O(),ot(t,()=>{t.style.height="auto",Y(t,D.current.open)}))});return w.observe(t),()=>w.disconnect()},[N,O,Y]),e.useEffect(()=>{},[]);let Ee=e.useCallback(t=>{i?.(t),!(E||M)&&(P==="focus"||P==="both")&&!l&&z(!0)},[E,M,P,l,z,i]),oe=e.useCallback(t=>{v(t.currentTarget.value),b?.(t)},[v,b]),Te=e.useCallback(t=>{if(c?.(t),t.defaultPrevented||!j||E||M)return;let R=Array.from(t.clipboardData?.items??[]).filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(w=>!!w);R.length!==0&&re(R)>0&&t.preventDefault()},[j,E,M,c,re]),Re=e.useCallback(t=>{q.current=!0,p?.(t)},[p]),Ce=e.useCallback(t=>{q.current=!1,S?.(t)},[S]),ge=e.useCallback(t=>{C?.(t),!(t.defaultPrevented||!A)&&(t.key!=="Enter"||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey||q.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||(t.preventDefault(),I(_)))},[A,C,I,_]),Le=f?U:"textarea";return e.createElement(he.div,{className:L("rt-ChatbarField","rt-ChatbarTextarea",r),layout:"position",transition:fe},e.createElement(Le,{...h,ref:be,className:"rt-ChatbarInput",value:H,onChange:oe,onFocus:Ee,onPaste:Te,onKeyDown:ge,onCompositionStart:Re,onCompositionEnd:Ce,disabled:E,readOnly:M,rows:l?g:1,spellCheck:h.spellCheck??!0,autoCorrect:h.autoCorrect??"on",style:d}))});dt.displayName="Chatbar.Textarea";var mt=e.forwardRef((n,s)=>{let{children:r,asChild:d,className:f,...i}=n;return K().open?null:e.createElement(d?U:"div",{...i,ref:s,className:L("rt-ChatbarInlineStart",f)},r)});mt.displayName="Chatbar.InlineStart";var pt=e.forwardRef((n,s)=>{let{children:r,asChild:d,className:f,...i}=n;return K().open?null:e.createElement(d?U:"div",{...i,ref:s,className:L("rt-ChatbarInlineEnd",f)},r)});pt.displayName="Chatbar.InlineEnd";var ht=e.forwardRef((n,s)=>{let{asChild:r,forceMount:d,renderAttachment:f,className:i,...b}=n,c=K();if(c.attachments.length===0&&!d)return null;let C=r?U:"div";return e.createElement(he.div,{layout:"position",transition:fe},e.createElement(C,{...b,ref:s,className:L("rt-ChatbarAttachmentsRow",i),role:"list","aria-label":b["aria-label"]??"Attachments"},e.createElement(nt,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},e.createElement(de,{align:"center",gap:"2",minWidth:"fit-content"},c.attachments.map(p=>e.createElement(Ue,{key:p.id,attachment:p,asChild:!!f},f?.(p)))))))});ht.displayName="Chatbar.AttachmentsRow";var Wt={uploading:"uploading",error:"failed to upload"},Ue=e.forwardRef((n,s)=>{let{attachment:r,asChild:d,className:f,children:i,...b}=n,c=K(),C=d?U:"div",p=!!r.url&<(r.name,r.type),S=`${Math.ceil(r.size/1024)} KB`,A=r.status?Wt[r.status]:void 0,h=c.disabled||c.readOnly,B=H=>{let l=H.currentTarget.closest('[role="listitem"]'),g=l?.parentElement?Array.from(l.parentElement.children):[],k=l?g.indexOf(l):-1,E=(g[k+1]??g[k-1])?.querySelector(".rt-ChatbarAttachmentRemove");E?E.focus():c.textareaRef.current?.focus({preventScroll:!0}),c.removeAttachment(r.id)};return e.createElement(C,{...b,ref:s,className:L("rt-ChatbarAttachment",f),role:"listitem","data-kind":p?"image":"file","data-status":r.status,title:r.name},i??e.createElement(de,{align:"center",gap:"2",pr:p?void 0:"6"},e.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},p?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:r.url,alt:""}):e.createElement(at,null)),p?e.createElement(Be,null,r.name,", ",S,A?`, ${A}`:""):e.createElement(de,{direction:"column",gap:"0",minWidth:"0"},e.createElement(me,{size:c.size,weight:"medium",truncate:!0},r.name),e.createElement(me,{size:"1",color:r.status==="error"?"red":void 0,emphasis:r.status==="error"?void 0:"medium"},S,A?` \xB7 ${A}`:"")),!h&&e.createElement(je,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${r.name}`,size:"1",variant:"classic",color:"gray",onClick:B},e.createElement(tt,null))))});Ue.displayName="Chatbar.Attachment";var ft=e.forwardRef((n,s)=>{let{asChild:r,accept:d,multiple:f,disabled:i,onPointerDown:b,onClick:c,...C}=n,p=K(),S=i||p.disabled||p.readOnly;return e.createElement(r?U:"button",{...C,ref:s,className:L("rt-ChatbarAttachTrigger",C.className),type:C.type??"button","aria-label":C["aria-label"]??"Add attachments",disabled:S,onPointerDown:h=>{b?.(h),!S&&!h.defaultPrevented&&p.beginFilePickerPress()},onClick:h=>{c?.(h),!(S||h.defaultPrevented)&&p.openFilePicker({accept:d,multiple:f})}})});ft.displayName="Chatbar.AttachTrigger";var bt=e.forwardRef((n,s)=>{let{asChild:r,children:d,className:f,...i}=n;if(!K().open)return null;let c=r?U:"div";return e.createElement(he.div,{layout:"position",transition:fe},e.createElement(c,{...i,ref:s,className:L("rt-ChatbarRow",f)},e.createElement(de,{align:"center",justify:"between",width:"100%"},d)))});bt.displayName="Chatbar.Row";var Rt=e.forwardRef((n,s)=>{let{className:r,...d}=n;return e.createElement("div",{...d,ref:s,className:L("rt-ChatbarRowStart",r)})});Rt.displayName="Chatbar.RowStart";var Ct=e.forwardRef((n,s)=>{let{className:r,...d}=n;return e.createElement("div",{...d,ref:s,className:L("rt-ChatbarRowEnd",r)})});Ct.displayName="Chatbar.RowEnd";var gt=e.forwardRef((n,s)=>{let{asChild:r,clearOnSend:d,disabled:f,children:i,style:b,className:c,size:C,variant:p,tabIndex:S,onClick:A,status:h="ready",onStop:B,onRetry:H,stopLabel:l="Stop",retryLabel:g="Retry",stopIcon:k,retryIcon:P,"aria-label":E,"aria-labelledby":M,...z}=n,v=K(),N=e.useContext($e),j=We(N)||v.attachments.length>0,y=j?"send":h==="submitted"||h==="streaming"?"stop":h==="error"?"retry":"send";if(v.sendMode==="never"&&y==="send")return null;let I=y!=="send"||v.sendMode==="always"||j,_=y==="send"?f||v.disabled||v.readOnly||!j:f||v.disabled,F=y==="stop"?{"aria-label":l}:y==="retry"?{"aria-label":g}:M?{"aria-labelledby":M}:{"aria-label":E??"Send"},G=D=>{if(A?.(D),D.defaultPrevented||_)return;if(y==="stop"){B?.();return}if(y==="retry"){H?.();return}let O=d??v.clearOnSubmit;v.submit(O)&&O&&v.textareaRef.current?.focus({preventScroll:!0})},q=y==="stop"?k??(h==="submitted"?e.createElement(et,{size:v.size}):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):y==="retry"?P??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):i??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(je,{...z,ref:s,size:C??v.size,variant:p??(v.open||y!=="send"?"solid":"ghost"),disabled:_,className:L("rt-ChatbarSend",c),style:{opacity:I?1:0,pointerEvents:I?void 0:"none",...b},"aria-hidden":I?void 0:!0,tabIndex:I?S:-1,asChild:r,onClick:G,"data-status":h,"data-mode":y,...F},q)});gt.displayName="Chatbar.Send";export{ut as a,dt as b,mt as c,pt as d,ht as e,Ue as f,ft as g,bt as h,Rt as i,Ct as j,gt as k,$t as l};
|
|
2
|
-
//# sourceMappingURL=chunk-ENLFKWYV.js.map
|