@liveblocks/react-ui 2.25.0-aiprivatebeta7 → 2.25.0-aiprivatebeta9

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 (135) hide show
  1. package/dist/_private/index.cjs +14 -10
  2. package/dist/_private/index.cjs.map +1 -1
  3. package/dist/_private/index.d.cts +200 -105
  4. package/dist/_private/index.d.ts +200 -105
  5. package/dist/_private/index.js +10 -5
  6. package/dist/_private/index.js.map +1 -1
  7. package/dist/components/AiChat.cjs +85 -120
  8. package/dist/components/AiChat.cjs.map +1 -1
  9. package/dist/components/AiChat.js +87 -122
  10. package/dist/components/AiChat.js.map +1 -1
  11. package/dist/components/AiTool.cjs +164 -0
  12. package/dist/components/AiTool.cjs.map +1 -0
  13. package/dist/components/AiTool.js +162 -0
  14. package/dist/components/AiTool.js.map +1 -0
  15. package/dist/components/Comment.cjs +5 -3
  16. package/dist/components/Comment.cjs.map +1 -1
  17. package/dist/components/Comment.js +6 -4
  18. package/dist/components/Comment.js.map +1 -1
  19. package/dist/components/InboxNotificationList.cjs +11 -3
  20. package/dist/components/InboxNotificationList.cjs.map +1 -1
  21. package/dist/components/InboxNotificationList.js +12 -4
  22. package/dist/components/InboxNotificationList.js.map +1 -1
  23. package/dist/components/Thread.cjs +3 -3
  24. package/dist/components/Thread.cjs.map +1 -1
  25. package/dist/components/Thread.js +3 -3
  26. package/dist/components/Thread.js.map +1 -1
  27. package/dist/components/internal/AiChatAssistantMessage.cjs +53 -229
  28. package/dist/components/internal/AiChatAssistantMessage.cjs.map +1 -1
  29. package/dist/components/internal/AiChatAssistantMessage.js +55 -231
  30. package/dist/components/internal/AiChatAssistantMessage.js.map +1 -1
  31. package/dist/components/internal/AiChatComposer.cjs +29 -17
  32. package/dist/components/internal/AiChatComposer.cjs.map +1 -1
  33. package/dist/components/internal/AiChatComposer.js +29 -17
  34. package/dist/components/internal/AiChatComposer.js.map +1 -1
  35. package/dist/components/internal/AiChatUserMessage.cjs +17 -10
  36. package/dist/components/internal/AiChatUserMessage.cjs.map +1 -1
  37. package/dist/components/internal/AiChatUserMessage.js +17 -10
  38. package/dist/components/internal/AiChatUserMessage.js.map +1 -1
  39. package/dist/components/internal/Button.cjs.map +1 -1
  40. package/dist/components/internal/Button.js.map +1 -1
  41. package/dist/components/internal/CodeBlock.cjs +72 -0
  42. package/dist/components/internal/CodeBlock.cjs.map +1 -0
  43. package/dist/components/internal/CodeBlock.js +70 -0
  44. package/dist/components/internal/CodeBlock.js.map +1 -0
  45. package/dist/components/internal/Emoji.cjs +12 -4
  46. package/dist/components/internal/Emoji.cjs.map +1 -1
  47. package/dist/components/internal/Emoji.js +12 -4
  48. package/dist/components/internal/Emoji.js.map +1 -1
  49. package/dist/components/internal/Prose.cjs +37 -0
  50. package/dist/components/internal/Prose.cjs.map +1 -0
  51. package/dist/components/internal/Prose.js +35 -0
  52. package/dist/components/internal/Prose.js.map +1 -0
  53. package/dist/icon.cjs +2 -0
  54. package/dist/icon.cjs.map +1 -1
  55. package/dist/icon.js +1 -0
  56. package/dist/icon.js.map +1 -1
  57. package/dist/icons/{Resolve.cjs → CheckCircle.cjs} +3 -3
  58. package/dist/icons/CheckCircle.cjs.map +1 -0
  59. package/dist/icons/{Resolve.js → CheckCircle.js} +3 -3
  60. package/dist/icons/CheckCircle.js.map +1 -0
  61. package/dist/icons/{Resolved.cjs → CheckCircleFill.cjs} +3 -3
  62. package/dist/icons/CheckCircleFill.cjs.map +1 -0
  63. package/dist/icons/{Resolved.js → CheckCircleFill.js} +3 -3
  64. package/dist/icons/CheckCircleFill.js.map +1 -0
  65. package/dist/icons/index.cjs +4 -4
  66. package/dist/icons/index.js +2 -2
  67. package/dist/index.cjs +2 -0
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.d.cts +68 -14
  70. package/dist/index.d.ts +68 -14
  71. package/dist/index.js +1 -0
  72. package/dist/index.js.map +1 -1
  73. package/dist/overrides.cjs +2 -8
  74. package/dist/overrides.cjs.map +1 -1
  75. package/dist/overrides.js +2 -8
  76. package/dist/overrides.js.map +1 -1
  77. package/dist/primitives/AiChatComposer/index.cjs +1 -2
  78. package/dist/primitives/AiChatComposer/index.cjs.map +1 -1
  79. package/dist/primitives/AiChatComposer/index.js +1 -2
  80. package/dist/primitives/AiChatComposer/index.js.map +1 -1
  81. package/dist/primitives/AiMessage/contexts.cjs +18 -0
  82. package/dist/primitives/AiMessage/contexts.cjs.map +1 -0
  83. package/dist/primitives/AiMessage/contexts.js +15 -0
  84. package/dist/primitives/AiMessage/contexts.js.map +1 -0
  85. package/dist/primitives/AiMessage/index.cjs +133 -0
  86. package/dist/primitives/AiMessage/index.cjs.map +1 -0
  87. package/dist/primitives/AiMessage/index.js +131 -0
  88. package/dist/primitives/AiMessage/index.js.map +1 -0
  89. package/dist/primitives/{internal/Collapsible → Collapsible}/index.cjs +39 -17
  90. package/dist/primitives/Collapsible/index.cjs.map +1 -0
  91. package/dist/primitives/{internal/Collapsible → Collapsible}/index.js +37 -15
  92. package/dist/primitives/Collapsible/index.js.map +1 -0
  93. package/dist/primitives/{internal/Markdown.cjs → Markdown.cjs} +150 -83
  94. package/dist/primitives/Markdown.cjs.map +1 -0
  95. package/dist/primitives/{internal/Markdown.js → Markdown.js} +151 -83
  96. package/dist/primitives/Markdown.js.map +1 -0
  97. package/dist/primitives/index.cjs +4 -6
  98. package/dist/primitives/index.cjs.map +1 -1
  99. package/dist/primitives/index.d.cts +2 -79
  100. package/dist/primitives/index.d.ts +2 -79
  101. package/dist/primitives/index.js +4 -6
  102. package/dist/primitives/index.js.map +1 -1
  103. package/dist/utils/ErrorBoundary.cjs +48 -0
  104. package/dist/utils/ErrorBoundary.cjs.map +1 -0
  105. package/dist/utils/ErrorBoundary.js +45 -0
  106. package/dist/utils/ErrorBoundary.js.map +1 -0
  107. package/dist/utils/use-visible.cjs +63 -45
  108. package/dist/utils/use-visible.cjs.map +1 -1
  109. package/dist/utils/use-visible.js +64 -46
  110. package/dist/utils/use-visible.js.map +1 -1
  111. package/dist/version.cjs +1 -1
  112. package/dist/version.js +1 -1
  113. package/package.json +5 -5
  114. package/src/styles/constants.css +1 -1
  115. package/src/styles/dark/index.css +7 -3
  116. package/src/styles/index.css +584 -238
  117. package/src/styles/utils.css +1 -1
  118. package/styles/dark/attributes.css +1 -1
  119. package/styles/dark/attributes.css.map +1 -1
  120. package/styles/dark/media-query.css +1 -1
  121. package/styles/dark/media-query.css.map +1 -1
  122. package/styles.css +1 -1
  123. package/styles.css.map +1 -1
  124. package/dist/icons/Resolve.cjs.map +0 -1
  125. package/dist/icons/Resolve.js.map +0 -1
  126. package/dist/icons/Resolved.cjs.map +0 -1
  127. package/dist/icons/Resolved.js.map +0 -1
  128. package/dist/primitives/internal/Collapsible/index.cjs.map +0 -1
  129. package/dist/primitives/internal/Collapsible/index.js.map +0 -1
  130. package/dist/primitives/internal/Emoji.cjs +0 -32
  131. package/dist/primitives/internal/Emoji.cjs.map +0 -1
  132. package/dist/primitives/internal/Emoji.js +0 -30
  133. package/dist/primitives/internal/Emoji.js.map +0 -1
  134. package/dist/primitives/internal/Markdown.cjs.map +0 -1
  135. package/dist/primitives/internal/Markdown.js.map +0 -1
@@ -26,7 +26,7 @@
26
26
  --lb-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
27
27
  --lb-highlight-shadow: inset 0 0 0 1px rgb(0 0 0 / 10%);
28
28
  --lb-elevation-shadow: $lb-elevation-shadow;
29
- --lb-elevation-shadow-small: $lb-elevation-shadow-small;
29
+ --lb-elevation-shadow-moderate: $lb-elevation-shadow-moderate;
30
30
  --lb-tooltip-shadow: $lb-tooltip-shadow;
31
31
  --lb-accent-contrast: 8%;
32
32
  --lb-destructive-contrast: 8%;
@@ -284,6 +284,23 @@
284
284
  }
285
285
  }
286
286
 
287
+ &:where([data-variant="destructive"]) {
288
+ --lb-button-background: var(--lb-destructive);
289
+
290
+ color: var(--lb-destructive-foreground);
291
+
292
+ &:where(
293
+ :enabled:hover,
294
+ :enabled:focus-visible,
295
+ [aria-expanded="true"],
296
+ [aria-selected="true"]
297
+ ) {
298
+ --lb-button-background: var(--lb-destructive-secondary);
299
+
300
+ color: var(--lb-destructive-foreground);
301
+ }
302
+ }
303
+
287
304
  &:where([data-variant="outline"]) {
288
305
  box-shadow: inset 0 0 0 1px var(--lb-foreground-subtle);
289
306
  transition-property: background, color, opacity, box-shadow;
@@ -451,6 +468,280 @@
451
468
  opacity: 0.75;
452
469
  }
453
470
 
471
+ /*************************************
472
+ * Collapsible *
473
+ *************************************/
474
+
475
+ .lb-collapsible-trigger {
476
+ all: unset;
477
+ position: relative;
478
+ box-sizing: inherit;
479
+ user-select: none;
480
+ transition-timing-function: var(--lb-transition-easing);
481
+ transition-duration: var(--lb-transition-duration);
482
+ transition-property: color, background, opacity;
483
+ -webkit-tap-highlight-color: transparent;
484
+
485
+ &:where(:not([data-disabled])) {
486
+ cursor: pointer;
487
+ }
488
+ }
489
+
490
+ .lb-collapsible-chevron {
491
+ inline-size: calc(0.8 * var(--lb-icon-size));
492
+ block-size: calc(0.8 * var(--lb-icon-size));
493
+ margin-inline-start: -1px;
494
+ margin-block-start: 1px;
495
+ color: var(--lb-foreground-moderate);
496
+ }
497
+
498
+ @media (prefers-reduced-motion: no-preference) {
499
+ @supports (interpolate-size: allow-keywords) {
500
+ .lb-collapsible-content {
501
+ block-size: 0;
502
+ opacity: 0;
503
+ transition-duration: calc(3 * var(--lb-transition-duration));
504
+ transition-property: block-size, opacity, content-visibility;
505
+ content-visibility: hidden;
506
+
507
+ /* overflow-block: clip; doesn't work as expected */
508
+ /* stylelint-disable-next-line plugin/use-logical-properties-and-values */
509
+ overflow-y: clip;
510
+
511
+ /* interpolate-size is a new-ish property */
512
+ /* stylelint-disable-next-line */
513
+ interpolate-size: allow-keywords;
514
+
515
+ /* transition-behavior is a new-ish property */
516
+ /* stylelint-disable-next-line */
517
+ transition-behavior: allow-discrete;
518
+
519
+ &:where([data-state="open"]) {
520
+ block-size: auto;
521
+ opacity: 1;
522
+ content-visibility: auto;
523
+
524
+ /* overflow-block: auto; doesn't work as expected */
525
+ /* stylelint-disable-next-line plugin/use-logical-properties-and-values */
526
+ overflow-y: auto;
527
+ }
528
+ }
529
+ }
530
+
531
+ .lb-collapsible-chevron {
532
+ transition-property: transform;
533
+
534
+ .lb-collapsible:where([data-state="open"]) :where(&) {
535
+ transform: rotate(90deg);
536
+ }
537
+ }
538
+ }
539
+
540
+ /* Fix default browser styles when `hidden="until-found"` isn't supported. */
541
+ .lb-collapsible-content:where([hidden]:not([hidden="until-found"])) {
542
+ display: none !important;
543
+ }
544
+
545
+ /*************************************
546
+ * Prose *
547
+ *************************************/
548
+
549
+ .lb-prose {
550
+ &,
551
+ * {
552
+ line-height: var(--lb-line-height);
553
+ }
554
+
555
+ :where(p) {
556
+ margin-block: 0.75em;
557
+ }
558
+
559
+ :where(p, li) {
560
+ text-wrap: pretty;
561
+ }
562
+
563
+ :where(h1, h2, h3, h4, h5, h6) {
564
+ margin-block-start: 1.5em;
565
+ margin-block-end: 0.375em;
566
+ font-weight: 600;
567
+ text-wrap: balance;
568
+ }
569
+
570
+ :where(h1) {
571
+ font-size: 1.75em;
572
+ line-height: calc(0.8 * var(--lb-line-height));
573
+ }
574
+
575
+ :where(h2) {
576
+ font-size: 1.5em;
577
+ line-height: calc(0.86 * var(--lb-line-height));
578
+ }
579
+
580
+ :where(h3) {
581
+ font-size: 1.25em;
582
+ line-height: calc(0.92 * var(--lb-line-height));
583
+ }
584
+
585
+ :where(h4) {
586
+ font-size: 1.125em;
587
+ line-height: calc(0.98 * var(--lb-line-height));
588
+ }
589
+
590
+ :where(h5) {
591
+ font-size: 1em;
592
+ }
593
+
594
+ :where(h6) {
595
+ font-size: 0.875em;
596
+ }
597
+
598
+ :where(hr) {
599
+ margin-block: 1.5em;
600
+ border: none;
601
+ border-block-start: 1px solid var(--lb-foreground-subtle);
602
+ }
603
+
604
+ :where(ol, ul) {
605
+ display: flex;
606
+ flex-direction: column;
607
+ gap: 0.25em;
608
+ margin-block: 0.75em;
609
+ padding-inline-start: 1.5em;
610
+ list-style-position: outside;
611
+
612
+ :where(ol, ul) {
613
+ margin-block: 0;
614
+ }
615
+ }
616
+
617
+ :where(ul) {
618
+ list-style-type: disc;
619
+ }
620
+
621
+ :where(ol) {
622
+ list-style-type: decimal;
623
+ }
624
+
625
+ :where(li) {
626
+ margin-block: 0;
627
+
628
+ > :where(ol, ul) {
629
+ margin-block-start: 0.25em;
630
+ }
631
+ }
632
+
633
+ :where(a) {
634
+ color: var(--lb-foreground);
635
+ outline: none;
636
+ font-weight: 500;
637
+ transition-property: color, text-decoration-color;
638
+ text-decoration-line: underline;
639
+ text-decoration-color: var(--lb-foreground-moderate);
640
+ text-underline-offset: 2px;
641
+
642
+ &:where([href]):where(:hover, :focus-visible) {
643
+ color: var(--lb-accent);
644
+ text-decoration-color: var(--lb-accent-moderate);
645
+ }
646
+ }
647
+
648
+ :where(strong) {
649
+ font-weight: 600;
650
+ }
651
+
652
+ :where(table) {
653
+ inline-size: 100%;
654
+ min-inline-size: 0;
655
+ margin-block: 1em;
656
+ border-collapse: collapse;
657
+ table-layout: auto;
658
+ word-break: break-word;
659
+ }
660
+
661
+ :where(thead) {
662
+ border-block-end: 2px solid var(--lb-foreground-subtle);
663
+
664
+ :where(th) {
665
+ vertical-align: bottom;
666
+ }
667
+ }
668
+
669
+ :where(tbody) {
670
+ :where(td) {
671
+ vertical-align: baseline;
672
+ }
673
+
674
+ :where(tr:not(:last-child)) {
675
+ border-block-end: 1px solid var(--lb-foreground-subtle);
676
+ }
677
+ }
678
+
679
+ :where(tfoot) {
680
+ border-block-start: 2px solid var(--lb-foreground-subtle);
681
+
682
+ :where(td) {
683
+ vertical-align: top;
684
+ }
685
+ }
686
+
687
+ :where(th, td) {
688
+ padding-inline: 0.75em;
689
+ padding-block: 0.5em;
690
+ text-align: start;
691
+
692
+ &:where(:first-child) {
693
+ padding-inline-start: 0;
694
+ }
695
+
696
+ &:where(:last-child) {
697
+ padding-inline-end: 0;
698
+ }
699
+ }
700
+
701
+ :where(.lb-code-block) {
702
+ margin-block: 1em;
703
+ }
704
+
705
+ :where(blockquote) {
706
+ position: relative;
707
+ margin-inline: 0;
708
+ margin-block: 0.75em;
709
+ padding: 0;
710
+ padding-inline-start: 1.25em;
711
+
712
+ &::after {
713
+ content: "";
714
+ position: absolute;
715
+ inset-inline-start: 0;
716
+ inset-block-start: 0;
717
+ inline-size: 4px;
718
+ block-size: 100%;
719
+ border-radius: calc(0.5 * var(--lb-radius));
720
+ background: var(--lb-foreground-subtle);
721
+ }
722
+
723
+ &:where(& + &) {
724
+ margin-block-start: 1em;
725
+ }
726
+
727
+ > :where(:first-child) {
728
+ margin-block-start: 0;
729
+ }
730
+
731
+ > :where(:last-child) {
732
+ margin-block-end: 0;
733
+ }
734
+ }
735
+
736
+ > :where(:first-child) {
737
+ margin-block-start: 0;
738
+ }
739
+
740
+ > :where(:last-child) {
741
+ margin-block-end: 0;
742
+ }
743
+ }
744
+
454
745
  /*************************************
455
746
  * Composer suggestions *
456
747
  *************************************/
@@ -510,6 +801,14 @@
510
801
  * Emoji *
511
802
  *************************************/
512
803
 
804
+ .lb-emoji {
805
+ display: inline-flex;
806
+ justify-content: center;
807
+ align-items: center;
808
+ inline-size: 1em;
809
+ white-space: nowrap;
810
+ }
811
+
513
812
  @include safari-only {
514
813
  .lb-emoji {
515
814
  transform: scale(0.825);
@@ -670,6 +969,7 @@
670
969
  --lb-background: #222;
671
970
  --lb-foreground: #fff;
672
971
  --lb-foreground-contrast: 10%;
972
+ --lb-dynamic-background: var(--lb-background);
673
973
 
674
974
  position: relative;
675
975
  display: flex;
@@ -1889,7 +2189,7 @@
1889
2189
  *************************************/
1890
2190
 
1891
2191
  :is(.lb-root) {
1892
- :where(code) {
2192
+ :where(code:not(pre > code)) {
1893
2193
  padding: 0.2em 0.4em;
1894
2194
  border-radius: calc(0.75 * var(--lb-radius));
1895
2195
  background: var(--lb-foreground-subtle);
@@ -1925,6 +2225,8 @@
1925
2225
  *************************************/
1926
2226
 
1927
2227
  .lb-elevation {
2228
+ --lb-dynamic-background: var(--lb-background);
2229
+
1928
2230
  position: relative;
1929
2231
  overflow: hidden;
1930
2232
  border-radius: var(--lb-radius);
@@ -1940,6 +2242,10 @@
1940
2242
  box-shadow: var(--lb-inset-shadow);
1941
2243
  pointer-events: none;
1942
2244
  }
2245
+
2246
+ &:where(.lb-elevation-moderate) {
2247
+ box-shadow: var(--lb-elevation-shadow-moderate);
2248
+ }
1943
2249
  }
1944
2250
 
1945
2251
  /*************************************
@@ -2049,9 +2355,56 @@
2049
2355
  }
2050
2356
  }
2051
2357
 
2358
+ /*************************************
2359
+ * Code block *
2360
+ *************************************/
2361
+
2362
+ .lb-code-block {
2363
+ min-inline-size: 0;
2364
+ border: 1px solid var(--lb-foreground-subtle);
2365
+ border-radius: var(--lb-radius);
2366
+
2367
+ :where(.lb-code-block-header) {
2368
+ display: flex;
2369
+ align-items: center;
2370
+ padding: calc(0.5 * var(--lb-spacing));
2371
+ }
2372
+
2373
+ :where(.lb-code-block-title) {
2374
+ margin-inline-start: calc(0.5 * var(--lb-spacing));
2375
+ color: var(--lb-foreground-tertiary);
2376
+ font-weight: 600;
2377
+ font-size: 0.675em;
2378
+ text-transform: uppercase;
2379
+ }
2380
+
2381
+ :where(.lb-code-block-header-actions) {
2382
+ margin-inline-start: auto;
2383
+ }
2384
+
2385
+ :where(.lb-code-block-content) {
2386
+ min-inline-size: 0;
2387
+ margin: 0;
2388
+ padding: 0 var(--lb-spacing) calc(0.875 * var(--lb-spacing));
2389
+ font-size: 85%;
2390
+ line-height: 1;
2391
+
2392
+ /* overflow-inline: auto; doesn't work as expected */
2393
+ /* stylelint-disable-next-line plugin/use-logical-properties-and-values */
2394
+ overflow-x: auto;
2395
+ }
2396
+ }
2397
+
2052
2398
  /*************************************
2053
2399
  * Chat Composer *
2054
2400
  *************************************/
2401
+
2402
+ .lb-ai-chat-composer {
2403
+ position: relative;
2404
+ inline-size: 100%;
2405
+ color: var(--lb-foreground);
2406
+ }
2407
+
2055
2408
  .lb-ai-chat-composer-form:where(
2056
2409
  :has(.lb-ai-chat-composer-editor:not(:focus-visible))
2057
2410
  ) {
@@ -2068,13 +2421,6 @@
2068
2421
  }
2069
2422
  }
2070
2423
 
2071
- .lb-ai-chat-composer-form {
2072
- position: relative;
2073
- background: var(--lb-dynamic-background);
2074
- color: var(--lb-foreground);
2075
- transition-property: background;
2076
- }
2077
-
2078
2424
  .lb-ai-chat-composer-editor {
2079
2425
  max-block-size: 15rem;
2080
2426
  padding: var(--lb-spacing) var(--lb-spacing) 0;
@@ -2144,265 +2490,93 @@
2144
2490
  .lb-ai-chat-message {
2145
2491
  display: flex;
2146
2492
  flex-direction: column;
2147
- gap: calc(0.75 * var(--lb-spacing));
2493
+ gap: var(--lb-spacing);
2148
2494
  color: var(--lb-foreground);
2149
-
2150
- @media (hover: hover) {
2151
- &:where(.lb-ai-chat-message\:show-actions-hover) {
2152
- :where(.lb-ai-chat-message-actions) {
2153
- opacity: 0;
2154
- transition-property: opacity;
2155
- }
2156
-
2157
- &:where(:is(:hover, :focus-within)) {
2158
- :where(.lb-ai-chat-message-actions) {
2159
- opacity: 1;
2160
- }
2161
- }
2162
- }
2163
- }
2164
- }
2165
-
2166
- .lb-ai-chat-message-content {
2167
- inline-size: 100%;
2168
- white-space: break-spaces;
2169
2495
  }
2170
2496
 
2171
2497
  .lb-ai-chat-user-message {
2172
2498
  :where(.lb-ai-chat-message-content) {
2499
+ min-block-size: calc(1lh + var(--lb-spacing));
2173
2500
  padding: calc(0.5 * var(--lb-spacing)) var(--lb-spacing);
2174
- border-radius: calc(3 * var(--lb-radius));
2501
+
2502
+ /**
2503
+ * Exactly half the height (line-height + padding) of a one line bubble,
2504
+ * so that it doesn't change when the text wraps and the bubble becomes taller.
2505
+ */
2506
+ border-radius: calc((1lh + var(--lb-spacing)) / 2);
2175
2507
  background: var(--lb-background-foreground-faint);
2176
2508
  color: var(--lb-foreground);
2509
+ line-height: var(--lb-line-height);
2177
2510
  }
2178
2511
  }
2179
2512
 
2180
- .lb-ai-chat-message-text {
2181
- display: flex;
2182
- flex-direction: column;
2183
-
2184
- &,
2185
- * {
2186
- line-height: var(--lb-line-height);
2187
- }
2188
-
2189
- :where(p) {
2190
- margin-block: 0.25em;
2191
- }
2192
-
2193
- :where(h1, h2, h3, h4, h5, h6) {
2194
- margin-block: 0.5em;
2195
- font-weight: 600;
2196
- }
2197
-
2198
- :where(h1) {
2199
- font-size: 1.75em;
2200
- }
2201
-
2202
- :where(h2) {
2203
- font-size: 1.5em;
2204
- }
2205
-
2206
- :where(h3) {
2207
- font-size: 1.25em;
2208
- }
2209
-
2210
- :where(h4) {
2211
- font-size: 1.125em;
2212
- }
2213
-
2214
- :where(h5) {
2215
- font-size: 1em;
2216
- }
2217
-
2218
- :where(h6) {
2219
- font-size: 0.875em;
2220
- }
2221
-
2222
- :where(hr) {
2223
- margin-block: calc(0.75 * var(--lb-spacing));
2224
- border-block-start: 1px solid var(--lb-foreground-subtle);
2225
- }
2226
-
2227
- :where(blockquote) {
2228
- position: relative;
2229
- margin-block-start: calc(0.75 * var(--lb-spacing));
2230
- padding: calc(0.375 * var(--lb-spacing)) calc(1.5 * var(--lb-spacing));
2231
-
2232
- &::after {
2233
- content: "";
2234
- position: absolute;
2235
- inset-inline-start: 0;
2236
- inset-block-start: 0;
2237
- inline-size: 4px;
2238
- block-size: 100%;
2239
- border-radius: calc(0.5 * var(--lb-radius));
2240
- background: var(--lb-foreground-subtle);
2241
- }
2242
- }
2243
-
2244
- :where(ol, ul) {
2245
- margin-block: calc(0.75 * var(--lb-spacing));
2246
- padding-inline-start: calc(1.5 * var(--lb-spacing));
2247
- list-style-position: outside;
2248
- }
2249
-
2250
- :where(ul) {
2251
- list-style-type: disc;
2252
- }
2253
-
2254
- :where(ol) {
2255
- list-style-type: decimal;
2256
- }
2257
-
2258
- :where(li) {
2259
- margin-block: calc(0.25 * var(--lb-spacing));
2260
- }
2261
-
2262
- /**
2263
- * Merge adjacent inline code elements
2264
- */
2265
- :where(span:has(code) + span code) {
2266
- padding-inline-start: 0;
2267
- border-start-start-radius: 0;
2268
- border-end-start-radius: 0;
2269
- }
2270
-
2271
- :where(span:has(code):has(+ span code) code) {
2272
- padding-inline-end: 0;
2273
- border-start-end-radius: 0;
2274
- border-end-end-radius: 0;
2275
- }
2276
-
2277
- :where(a) {
2278
- color: var(--lb-foreground);
2279
- outline: none;
2280
- font-weight: 500;
2281
- transition-property: color, text-decoration-color;
2282
- text-decoration-line: underline;
2283
- text-decoration-color: var(--lb-foreground-moderate);
2284
- text-underline-offset: 2px;
2285
-
2286
- &:where([href]):where(:hover, :focus-visible) {
2287
- color: var(--lb-accent);
2288
- text-decoration-color: var(--lb-accent-moderate);
2289
- }
2290
- }
2291
-
2292
- :where(code) {
2293
- padding: 0.2em 0.4em;
2294
- border-radius: calc(0.75 * var(--lb-radius));
2295
- background: var(--lb-foreground-subtle);
2296
- box-decoration-break: clone;
2297
- font-size: 85%;
2298
- line-height: 1;
2299
- }
2300
-
2301
- :where(pre) {
2302
- margin-block: 0.25em;
2303
- padding: var(--lb-spacing);
2304
- border-radius: var(--lb-radius);
2305
- box-decoration-break: clone;
2306
- box-shadow: var(--lb-foreground-subtle) 0 0 0 1px inset;
2307
-
2308
- :where(code) {
2309
- padding: 0;
2310
- background: transparent;
2311
- }
2312
- }
2313
-
2314
- :where(strong) {
2315
- font-weight: 600;
2316
- }
2317
- }
2318
-
2319
- .lb-ai-chat-message-tool {
2320
- margin-block: calc(0.25 * var(--lb-spacing));
2321
- }
2322
-
2323
- .lb-ai-chat-message-deleted {
2324
- position: relative;
2325
- align-items: center;
2326
- inline-size: 100%;
2327
- color: var(--lb-foreground-moderate);
2328
- font-size: 0.875em;
2329
- text-wrap: balance;
2330
- }
2513
+ .lb-ai-chat-message-deleted {
2514
+ position: relative;
2515
+ align-items: center;
2516
+ inline-size: 100%;
2517
+ color: var(--lb-foreground-moderate);
2518
+ font-size: 0.875em;
2519
+ text-wrap: pretty;
2520
+ }
2331
2521
 
2332
2522
  .lb-ai-chat-message-error {
2333
- --lb-dynamic-background: var(--lb-background-destructive-subtle);
2334
-
2335
- position: relative;
2336
2523
  display: flex;
2337
2524
  gap: calc(0.5 * var(--lb-spacing));
2338
- align-items: center;
2525
+ align-items: flex-start;
2339
2526
  inline-size: 100%;
2340
- padding: calc(0.75 * var(--lb-spacing));
2341
- border-radius: var(--lb-radius);
2342
- background: var(--lb-dynamic-background);
2343
2527
  color: var(--lb-destructive);
2344
2528
  font-size: 0.875em;
2345
- text-wrap: balance;
2529
+ line-height: var(--lb-line-height);
2530
+ text-wrap: pretty;
2531
+ word-break: break-word;
2346
2532
 
2347
2533
  :where(.lb-icon-container) {
2534
+ block-size: 1lh;
2348
2535
  color: var(--lb-destructive-secondary);
2349
2536
  }
2350
2537
  }
2351
2538
 
2352
- .lb-ai-chat-assistant-message-collapsible {
2353
- position: relative;
2354
- display: flex;
2355
- flex-direction: column;
2539
+ .lb-ai-chat-message-content {
2356
2540
  inline-size: 100%;
2357
- color: var(--lb-foreground-secondary);
2358
- font-size: 0.875em;
2359
- }
2541
+ white-space: break-spaces;
2360
2542
 
2361
- .lb-ai-chat-message-collapsible-trigger {
2362
- @include truncate;
2543
+ &:where(:empty) {
2544
+ display: contents;
2545
+ }
2363
2546
 
2364
- display: flex;
2365
- gap: calc(0.25 * var(--lb-spacing));
2366
- align-items: center;
2367
- cursor: pointer;
2368
- }
2547
+ > :where(.lb-ai-chat-message-text) {
2548
+ margin-block: var(--lb-spacing);
2549
+ }
2369
2550
 
2370
- .lb-ai-chat-message-collapsible-content {
2371
- display: flex;
2372
- gap: calc(0.5 * var(--lb-spacing));
2373
- line-height: var(--lb-line-height);
2551
+ > :where(.lb-ai-chat-message-tool-invocation) {
2552
+ margin-block: var(--lb-spacing);
2553
+ }
2374
2554
 
2375
- &:where([data-state="open"]) {
2376
- margin-block-start: 0.25em;
2555
+ > :where(:first-child) {
2556
+ margin-block-start: 0;
2377
2557
  }
2378
- }
2379
2558
 
2380
- .lb-ai-chat-message-actions {
2381
- display: flex;
2382
- gap: calc(0.125 * var(--lb-spacing));
2383
- align-items: center;
2559
+ > :where(:last-child) {
2560
+ margin-block-end: 0;
2561
+ }
2384
2562
  }
2385
2563
 
2386
2564
  .lb-ai-chat-messages {
2387
2565
  display: flex;
2388
2566
  flex-direction: column;
2389
- gap: calc(0.75 * var(--lb-spacing));
2567
+ gap: var(--lb-spacing);
2390
2568
  inline-size: 100%;
2391
2569
  max-inline-size: min(
2392
2570
  calc(var(--lb-ai-chat-container-width) - var(--lb-spacing)),
2393
2571
  calc(100% - 3 * var(--lb-spacing))
2394
2572
  );
2395
2573
  margin-inline: auto;
2396
- padding-block-start: var(--lb-spacing);
2397
- padding-block-end: calc(5 * var(--lb-spacing));
2574
+ padding-block-start: calc(1.5 * var(--lb-spacing));
2575
+ padding-block-end: calc(3 * var(--lb-spacing));
2398
2576
 
2399
2577
  :where(.lb-ai-chat-user-message) {
2400
2578
  max-inline-size: 80%;
2401
2579
  margin-inline-start: auto;
2402
-
2403
- :where(.lb-ai-chat-message-actions) {
2404
- margin-inline-start: auto;
2405
- }
2406
2580
  }
2407
2581
  }
2408
2582
 
@@ -2433,6 +2607,36 @@
2433
2607
  inset-block-end: 0;
2434
2608
  z-index: 1;
2435
2609
  margin-block-start: auto;
2610
+ }
2611
+
2612
+ :where(.lb-ai-chat-composer) {
2613
+ margin-inline: auto;
2614
+ }
2615
+ }
2616
+
2617
+ .lb-ai-chat:where(.lb-ai-chat\:layout-compact) {
2618
+ :where(.lb-ai-chat-footer) {
2619
+ background: var(--lb-dynamic-background);
2620
+
2621
+ &::after {
2622
+ content: "";
2623
+ position: absolute;
2624
+ inset: 0;
2625
+ border-block-start: 1px solid var(--lb-foreground-subtle);
2626
+ pointer-events: none;
2627
+ }
2628
+ }
2629
+
2630
+ :where(.lb-ai-chat-composer) {
2631
+ max-inline-size: min(
2632
+ 100%,
2633
+ calc(var(--lb-ai-chat-container-width) + var(--lb-spacing))
2634
+ );
2635
+ }
2636
+ }
2637
+
2638
+ .lb-ai-chat:where(.lb-ai-chat\:layout-inset) {
2639
+ :where(.lb-ai-chat-footer) {
2436
2640
  padding: var(--lb-spacing);
2437
2641
  padding-block-start: 0;
2438
2642
 
@@ -2452,13 +2656,15 @@
2452
2656
 
2453
2657
  :where(.lb-ai-chat-composer) {
2454
2658
  max-inline-size: var(--lb-ai-chat-container-width);
2455
- margin-inline: auto;
2456
2659
  border-radius: calc(2 * var(--lb-radius));
2457
- background: var(--lb-dynamic-background);
2458
- box-shadow: var(--lb-elevation-shadow-small);
2459
2660
  }
2460
2661
  }
2461
2662
 
2663
+ .lb-ai-chat-content {
2664
+ position: relative;
2665
+ flex: 1 0 auto;
2666
+ }
2667
+
2462
2668
  .lb-ai-chat-footer-actions {
2463
2669
  position: absolute;
2464
2670
  inset-inline: 0;
@@ -2469,11 +2675,6 @@
2469
2675
  transform: translateY(-100%);
2470
2676
  }
2471
2677
 
2472
- .lb-ai-chat-composer {
2473
- position: relative;
2474
- inline-size: 100%;
2475
- }
2476
-
2477
2678
  .lb-ai-chat-scroll-indicator {
2478
2679
  border-radius: $lb-radius-full;
2479
2680
  color: var(--lb-foreground-moderate);
@@ -2517,10 +2718,155 @@
2517
2718
  }
2518
2719
 
2519
2720
  .lb-ai-chat-pending {
2721
+ user-select: none;
2722
+ animation: lb-animation-shimmer-small 5s linear infinite;
2723
+ }
2724
+
2725
+ .lb-ai-chat-message-thinking,
2726
+ .lb-ai-chat-message-reasoning {
2727
+ inline-size: fit-content;
2728
+ max-inline-size: 100%;
2729
+ color: var(--lb-foreground-tertiary);
2730
+
2731
+ &:where(.lb-ai-chat-pending),
2732
+ :where(.lb-ai-chat-pending) {
2733
+ color: var(--lb-foreground);
2734
+ }
2735
+ }
2736
+
2737
+ .lb-ai-chat-message-reasoning {
2738
+ margin-block-end: calc(0.75 * var(--lb-spacing));
2739
+
2740
+ :where(.lb-collapsible-trigger) {
2741
+ display: flex;
2742
+ gap: calc(0.25 * var(--lb-spacing));
2743
+ align-items: center;
2744
+
2745
+ &:where(:focus-visible) {
2746
+ color: var(--lb-accent);
2747
+
2748
+ :where(.lb-collapsible-chevron) {
2749
+ color: var(--lb-accent-moderate);
2750
+ }
2751
+ }
2752
+ }
2753
+
2754
+ :where(.lb-collapsible-content) {
2755
+ display: flex;
2756
+ flex-direction: column;
2757
+ gap: calc(0.5 * var(--lb-spacing));
2758
+ line-height: var(--lb-line-height);
2759
+
2760
+ :where(& > *:first-child) {
2761
+ margin-block-start: calc(0.5 * var(--lb-spacing));
2762
+ }
2763
+ }
2764
+
2765
+ :where(.lb-prose) {
2766
+ color: var(--lb-foreground);
2767
+ font-size: 0.875em;
2768
+ opacity: 0.75;
2769
+ }
2770
+ }
2771
+
2772
+ .lb-ai-tool {
2773
+ position: relative;
2774
+ border-radius: var(--lb-radius);
2775
+ box-shadow: inset 0 0 0 1px var(--lb-foreground-subtle);
2776
+
2777
+ &::after {
2778
+ content: "";
2779
+ position: absolute;
2780
+ inset: 0;
2781
+ border-radius: inherit;
2782
+ pointer-events: none;
2783
+ transition-property: box-shadow;
2784
+ }
2785
+
2786
+ &:where(:has(.lb-ai-tool-header:focus-visible)) {
2787
+ z-index: 1;
2788
+
2789
+ &::after {
2790
+ box-shadow:
2791
+ var(--lb-dynamic-background) 0 0 0 2px,
2792
+ var(--lb-accent) 0 0 0 4px;
2793
+ }
2794
+ }
2795
+ }
2796
+
2797
+ .lb-ai-tool-header {
2798
+ display: flex;
2799
+ gap: calc(0.25 * var(--lb-spacing));
2800
+ align-items: center;
2801
+ inline-size: 100%;
2802
+ block-size: calc($lb-button-size + var(--lb-spacing));
2803
+ padding-inline: calc(0.5 * var(--lb-spacing));
2804
+ }
2805
+
2806
+ .lb-ai-tool-header-icon-container,
2807
+ .lb-ai-tool-icon {
2808
+ display: flex;
2809
+ flex: none;
2810
+ justify-content: center;
2811
+ align-items: center;
2812
+ inline-size: $lb-button-size;
2813
+ block-size: $lb-button-size;
2814
+ }
2815
+
2816
+ .lb-ai-tool-header-icon-container {
2817
+ color: var(--lb-foreground-moderate);
2818
+
2819
+ &:where(:has(.lb-ai-tool-icon)) {
2820
+ margin-inline-end: calc(0.25 * var(--lb-spacing));
2821
+ }
2822
+ }
2823
+
2824
+ .lb-ai-tool-icon {
2825
+ border-radius: calc(0.75 * var(--lb-radius));
2826
+ background: var(--lb-foreground-subtle);
2827
+ font-size: 0.875em;
2828
+ }
2829
+
2830
+ .lb-ai-tool-header-title {
2520
2831
  @include truncate;
2521
2832
 
2522
- user-select: none;
2523
- animation: lb-animation-shimmer-small 8s linear infinite;
2833
+ color: var(--lb-foreground-secondary);
2834
+ font-size: 0.9375em;
2835
+
2836
+ &:where(:first-child) {
2837
+ margin-inline-start: calc(0.25 * var(--lb-spacing));
2838
+ }
2839
+ }
2840
+
2841
+ .lb-ai-tool-header-status {
2842
+ flex: none;
2843
+ margin-inline-start: auto;
2844
+ margin-inline-end: calc(0.25 * var(--lb-spacing));
2845
+ color: var(--lb-foreground-moderate);
2846
+ }
2847
+
2848
+ .lb-ai-tool-content {
2849
+ margin: 0 calc(0.75 * var(--lb-spacing)) calc(0.75 * var(--lb-spacing));
2850
+ }
2851
+
2852
+ .lb-ai-tool-inspector {
2853
+ display: flex;
2854
+ flex-direction: column;
2855
+ gap: calc(0.75 * var(--lb-spacing));
2856
+ }
2857
+
2858
+ .lb-ai-tool-confirmation-footer {
2859
+ display: flex;
2860
+ align-items: center;
2861
+ margin-block-start: calc(0.75 * var(--lb-spacing));
2862
+ }
2863
+
2864
+ .lb-ai-tool-confirmation-actions {
2865
+ display: flex;
2866
+ gap: calc(0.75 * var(--lb-spacing));
2867
+ justify-content: flex-end;
2868
+ align-items: center;
2869
+ margin-inline-start: auto;
2524
2870
  }
2525
2871
 
2526
2872
  /*************************************
@@ -2598,12 +2944,12 @@
2598
2944
  to {
2599
2945
  mask-image: linear-gradient(
2600
2946
  90deg,
2601
- #000 8%,
2602
- rgb(0 0 0 / 50%) 20%,
2603
- rgb(0 0 0 / 50%) 80%,
2604
- #000 92%
2947
+ #000 0%,
2948
+ rgb(0 0 0 / 50%) 18%,
2949
+ rgb(0 0 0 / 50%) 82%,
2950
+ #000 100%
2605
2951
  );
2606
- mask-size: 400% 100%;
2952
+ mask-size: 300% 100%;
2607
2953
  }
2608
2954
 
2609
2955
  from {
@@ -2611,7 +2957,7 @@
2611
2957
  }
2612
2958
 
2613
2959
  to {
2614
- mask-position: -200% 0;
2960
+ mask-position: -100% 0;
2615
2961
  }
2616
2962
  }
2617
2963