@duskmoon-dev/components 0.5.2 → 0.5.4

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.
@@ -4,7 +4,7 @@
4
4
  import { useCallback, useState } from "react";
5
5
 
6
6
  // src/generated/version.ts
7
- var version = "0.5.2";
7
+ var version = "0.5.4";
8
8
 
9
9
  // src/infrastructure.ts
10
10
  var theme = {
package/dist/styles.css CHANGED
@@ -43,8 +43,8 @@ html {
43
43
  color: var(--color-base-content);
44
44
  }
45
45
 
46
- /* Focus ring utility */
47
- :focus-visible {
46
+ /* Focus ring utility; the integrated chat input uses its composer's ring. */
47
+ :focus-visible:not(:where(.chat-composer .chat-composer-input)) {
48
48
  outline: 2px solid var(--color-primary);
49
49
  outline-offset: 2px;
50
50
  }
@@ -6677,6 +6677,103 @@ html {
6677
6677
  justify-self: end;
6678
6678
  }
6679
6679
 
6680
+ .chat-agent {
6681
+ align-items: start;
6682
+ row-gap: 0.5rem;
6683
+ padding: 0.75rem 0;
6684
+ min-inline-size: 0;
6685
+ color: var(--color-on-surface);
6686
+ }
6687
+
6688
+ .chat-agent:not(:has(> .chat-avatar)) {
6689
+ grid-template-columns: minmax(0, 1fr);
6690
+ }
6691
+
6692
+ .chat-agent:not(:has(> .chat-avatar)) > * {
6693
+ grid-column: 1;
6694
+ }
6695
+
6696
+ .chat-agent .chat-avatar {
6697
+ grid-row: 1;
6698
+ }
6699
+
6700
+ .chat-content {
6701
+ width: 100%;
6702
+ min-inline-size: 0;
6703
+ box-sizing: border-box;
6704
+ color: var(--color-on-surface);
6705
+ font-size: 0.9375rem;
6706
+ line-height: 1.6;
6707
+ overflow-wrap: anywhere;
6708
+ }
6709
+
6710
+ .chat-content pre {
6711
+ max-inline-size: 100%;
6712
+ min-inline-size: 0;
6713
+ overflow: auto;
6714
+ white-space: pre;
6715
+ }
6716
+
6717
+ .chat-content a {
6718
+ overflow-wrap: anywhere;
6719
+ text-decoration: underline;
6720
+ }
6721
+
6722
+ .chat-work {
6723
+ width: 100%;
6724
+ min-inline-size: 0;
6725
+ border: 0;
6726
+ padding: 0;
6727
+ background: transparent;
6728
+ }
6729
+
6730
+ .chat-work-summary {
6731
+ display: flex;
6732
+ flex-wrap: wrap;
6733
+ align-items: center;
6734
+ gap: 0.5rem;
6735
+ padding: 0.5rem 0;
6736
+ border-block-end: 1px solid var(--color-outline-variant);
6737
+ color: var(--color-on-surface-variant);
6738
+ font-size: 0.8125rem;
6739
+ line-height: 1.5;
6740
+ overflow-wrap: anywhere;
6741
+ list-style: none;
6742
+ cursor: pointer;
6743
+ }
6744
+
6745
+ .chat-work-summary::-webkit-details-marker {
6746
+ display: none;
6747
+ }
6748
+
6749
+ .chat-work-summary::after {
6750
+ content: "›";
6751
+ flex-shrink: 0;
6752
+ }
6753
+
6754
+ .chat-work[open] > .chat-work-summary::after {
6755
+ transform: rotate(90deg);
6756
+ }
6757
+
6758
+ .chat-work-summary:focus-visible {
6759
+ outline: none;
6760
+ box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 20%, transparent);
6761
+ }
6762
+
6763
+ .chat-work-body {
6764
+ display: flex;
6765
+ flex-direction: column;
6766
+ gap: 0.5rem;
6767
+ padding: 0.75rem 0;
6768
+ }
6769
+
6770
+ .chat-agent .chat-reasoning,
6771
+ .chat-agent .chat-tool {
6772
+ width: 100%;
6773
+ max-width: none;
6774
+ box-sizing: border-box;
6775
+ }
6776
+
6680
6777
  .chat-header,
6681
6778
  .chat-footer {
6682
6779
  color: var(--color-on-surface-variant);
@@ -6741,6 +6838,206 @@ html {
6741
6838
  }
6742
6839
  }
6743
6840
 
6841
+ /** Waiting messages; the application owns dispatch, steer, and removal. */
6842
+ .chat-input-area {
6843
+ display: flex;
6844
+ flex-direction: column;
6845
+ min-inline-size: 0;
6846
+ box-sizing: border-box;
6847
+ color: var(--color-on-surface);
6848
+ }
6849
+
6850
+ .chat-input-area > .chat-queue {
6851
+ margin-inline: 0.75rem;
6852
+ margin-block-end: -0.5rem;
6853
+ padding: 0.125rem 0.5rem 0.625rem;
6854
+ border-block-end: 0;
6855
+ border-radius: var(--radius-xl) var(--radius-xl) 0 0;
6856
+ }
6857
+
6858
+ .chat-input-area > .chat-queue .chat-queue-header:not(.sr-only) {
6859
+ padding: 0.125rem 0 0.5rem;
6860
+ }
6861
+
6862
+ .chat-input-area > .chat-queue .chat-queue-list {
6863
+ padding: 0;
6864
+ }
6865
+
6866
+ .chat-queue {
6867
+ min-inline-size: 0;
6868
+ max-inline-size: 100%;
6869
+ box-sizing: border-box;
6870
+ border: 1px solid var(--color-outline-variant);
6871
+ border-radius: var(--radius-md);
6872
+ background-color: var(--color-surface-container-low);
6873
+ color: var(--color-on-surface);
6874
+ font-size: 0.875rem;
6875
+ line-height: 1.45;
6876
+ }
6877
+
6878
+ .chat-queue-header:not(.sr-only) {
6879
+ display: flex;
6880
+ flex-wrap: wrap;
6881
+ align-items: center;
6882
+ justify-content: space-between;
6883
+ gap: 0.5rem;
6884
+ padding: 0.625rem 0.875rem;
6885
+ }
6886
+
6887
+ .chat-queue-title {
6888
+ margin: 0;
6889
+ font-size: inherit;
6890
+ font-weight: 600;
6891
+ overflow-wrap: anywhere;
6892
+ }
6893
+
6894
+ .chat-queue-list {
6895
+ display: flex;
6896
+ flex-direction: column;
6897
+ gap: 0;
6898
+ max-block-size: 16rem;
6899
+ overflow-y: auto;
6900
+ overscroll-behavior: contain;
6901
+ margin: 0;
6902
+ padding: 0 0.875rem 0.875rem;
6903
+ box-sizing: border-box;
6904
+ list-style: none;
6905
+ }
6906
+
6907
+ .chat-queue-item {
6908
+ display: flex;
6909
+ flex-shrink: 0;
6910
+ flex-wrap: nowrap;
6911
+ align-items: center;
6912
+ gap: 0.375rem;
6913
+ min-inline-size: 0;
6914
+ max-inline-size: 100%;
6915
+ box-sizing: border-box;
6916
+ padding: 0.375rem 0.5rem;
6917
+ border: 0;
6918
+ background-color: transparent;
6919
+ }
6920
+
6921
+ .chat-queue-icon {
6922
+ flex-shrink: 0;
6923
+ inline-size: 1rem;
6924
+ block-size: 1rem;
6925
+ color: var(--color-on-surface-variant);
6926
+ }
6927
+
6928
+ .chat-queue-item-active .chat-queue-icon {
6929
+ color: var(--color-on-surface);
6930
+ }
6931
+
6932
+ .chat-queue-attachment {
6933
+ flex-shrink: 0;
6934
+ inline-size: 2rem;
6935
+ block-size: 2rem;
6936
+ object-fit: cover;
6937
+ border-radius: var(--radius-xs);
6938
+ }
6939
+
6940
+ .chat-queue-number {
6941
+ flex-shrink: 0;
6942
+ color: var(--color-on-surface-variant);
6943
+ font-variant-numeric: tabular-nums;
6944
+ }
6945
+
6946
+ .chat-queue-count {
6947
+ white-space: nowrap;
6948
+ }
6949
+
6950
+ .chat-queue-content {
6951
+ flex: 1 1 8rem;
6952
+ min-inline-size: 0;
6953
+ margin: 0;
6954
+ overflow: hidden;
6955
+ white-space: nowrap;
6956
+ text-overflow: ellipsis;
6957
+ }
6958
+
6959
+ .chat-queue-actions {
6960
+ flex-wrap: nowrap;
6961
+ flex-shrink: 0;
6962
+ margin-inline-start: auto;
6963
+ }
6964
+
6965
+ .chat-queue-steer,
6966
+ .chat-queue-remove {
6967
+ flex-shrink: 0;
6968
+ }
6969
+
6970
+ .chat-queue[hidden],
6971
+ .chat-queue-item[hidden] {
6972
+ display: none;
6973
+ }
6974
+
6975
+ .chat-composer {
6976
+ position: relative;
6977
+ display: flex;
6978
+ flex-direction: column;
6979
+ gap: 0.5rem;
6980
+ min-inline-size: 0;
6981
+ box-sizing: border-box;
6982
+ margin: 0;
6983
+ padding: 1rem;
6984
+ border: 1px solid currentColor;
6985
+ border-radius: var(--radius-xl);
6986
+ background-color: var(--color-surface-container-high);
6987
+ color: var(--color-on-surface);
6988
+ }
6989
+
6990
+ .chat-composer:focus-within {
6991
+ box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 20%, transparent);
6992
+ }
6993
+
6994
+ .chat-composer-input {
6995
+ display: block;
6996
+ width: 100%;
6997
+ min-inline-size: 0;
6998
+ min-block-size: 3rem;
6999
+ box-sizing: border-box;
7000
+ margin: 0;
7001
+ padding: 0;
7002
+ border: 0;
7003
+ outline: none;
7004
+ background-color: transparent;
7005
+ color: var(--color-on-surface);
7006
+ font: inherit;
7007
+ font-size: 0.9375rem;
7008
+ line-height: 1.5;
7009
+ resize: vertical;
7010
+ }
7011
+
7012
+ .chat-composer-input::placeholder {
7013
+ color: var(--color-on-surface-variant);
7014
+ opacity: 1;
7015
+ }
7016
+
7017
+ .chat-composer-actions {
7018
+ display: flex;
7019
+ flex-wrap: wrap;
7020
+ align-items: center;
7021
+ justify-content: flex-end;
7022
+ gap: 0.5rem;
7023
+ }
7024
+
7025
+ .chat-composer-hint {
7026
+ font-family: inherit;
7027
+ font-size: 0.75rem;
7028
+ font-weight: 400;
7029
+ opacity: 1;
7030
+ }
7031
+
7032
+ .chat-composer-primary { color: var(--color-primary); }
7033
+ .chat-composer-secondary { color: var(--color-secondary); }
7034
+ .chat-composer-tertiary { color: var(--color-tertiary); }
7035
+ .chat-composer-info { color: var(--color-info); }
7036
+ .chat-composer-success { color: var(--color-success); }
7037
+ .chat-composer-warning { color: var(--color-warning); }
7038
+ .chat-composer-error { color: var(--color-error); }
7039
+ .chat-composer-ghost { border-color: transparent; }
7040
+
6744
7041
  .chat-bubble {
6745
7042
  --chat-bubble-bg: var(--color-surface-container-highest);
6746
7043
  --chat-bubble-fg: var(--color-on-surface);
@@ -6766,40 +7063,29 @@ html {
6766
7063
  .chat-bubble-content {
6767
7064
  min-width: 0;
6768
7065
  }
6769
- .chat-bubble pre { max-inline-size: 100%; min-inline-size: 0; overflow: auto; white-space: pre; }
6770
- .chat-bubble a { overflow-wrap: anywhere; text-decoration: underline; }
6771
-
6772
- .chat-start .chat-bubble::before,
6773
- .chat-end .chat-bubble::before {
6774
- content: "";
6775
- position: absolute;
6776
- inset-block-start: 0;
6777
- inline-size: 0.75rem;
6778
- block-size: 0.75rem;
6779
- background-color: var(--chat-bubble-bg);
6780
- mask-image: radial-gradient(ellipse at 0 100%, transparent 68%, black 72%);
6781
- pointer-events: none;
6782
- }
6783
7066
 
6784
- .chat-start .chat-bubble::before {
6785
- inset-inline-start: -0.5rem;
7067
+ .chat-bubble-collapsible > .chat-bubble-content {
7068
+ max-block-size: 6lh;
7069
+ overflow: hidden;
7070
+ white-space: pre-wrap;
6786
7071
  }
6787
7072
 
6788
- .chat-start .chat-bubble {
6789
- border-start-start-radius: 0;
7073
+ .chat-bubble-collapsible:has(> .chat-bubble-toggle[aria-expanded="true"]) > .chat-bubble-content {
7074
+ max-block-size: none;
7075
+ overflow: visible;
6790
7076
  }
6791
7077
 
6792
- .chat-end .chat-bubble::before {
6793
- inset-inline-end: -0.5rem;
6794
- transform: scaleX(-1);
7078
+ .chat-bubble-toggle {
7079
+ align-self: flex-end;
7080
+ color: inherit;
6795
7081
  }
6796
7082
 
6797
- .chat-end .chat-bubble {
6798
- border-start-end-radius: 0;
7083
+ .chat-bubble-toggle[hidden] {
7084
+ display: none;
6799
7085
  }
6800
7086
 
6801
- .chat-start:dir(rtl) .chat-bubble::before { transform: scaleX(-1); }
6802
- .chat-end:dir(rtl) .chat-bubble::before { transform: none; }
7087
+ .chat-bubble pre { max-inline-size: 100%; min-inline-size: 0; overflow: auto; white-space: pre; }
7088
+ .chat-bubble a { overflow-wrap: anywhere; text-decoration: underline; }
6803
7089
 
6804
7090
  .chat-bubble-primary {
6805
7091
  --chat-bubble-bg: var(--color-primary-container);
@@ -7069,6 +7355,7 @@ html {
7069
7355
  animation-delay: 300ms;
7070
7356
  }
7071
7357
 
7358
+ .chat-streaming::after,
7072
7359
  .chat-bubble-streaming::after,
7073
7360
  .chat-bubble-content.chat-bubble-streaming::after {
7074
7361
  content: "";
@@ -7148,12 +7435,14 @@ html {
7148
7435
  .chat-typing::before,
7149
7436
  .chat-typing::after,
7150
7437
  .chat-typing span,
7438
+ .chat-streaming::after,
7151
7439
  .chat-bubble-streaming::after,
7152
7440
  .chat-bubble-content.chat-bubble-streaming::after,
7153
7441
  .chat-tool-running .chat-tool-header::before {
7154
7442
  animation: none;
7155
7443
  }
7156
7444
 
7445
+ .chat-streaming::after,
7157
7446
  .chat-bubble-streaming::after,
7158
7447
  .chat-bubble-content.chat-bubble-streaming::after {
7159
7448
  opacity: 1;
@@ -22879,6 +23168,20 @@ html {
22879
23168
  margin-block-end: 0.5rem;
22880
23169
  }
22881
23170
 
23171
+ /* Chat prose follows the bubble; embedded surfaces keep their own color pair. */
23172
+ .chat-bubble .markdown-body,
23173
+ .chat-bubble .markdown-body :is(a, blockquote, h6, del, s, figcaption) {
23174
+ color: inherit;
23175
+ }
23176
+
23177
+ .chat-bubble .markdown-body a {
23178
+ text-decoration: underline;
23179
+ }
23180
+
23181
+ .chat-bubble .markdown-body :is(code, pre, kbd, th, tr:nth-child(2n)) {
23182
+ color: var(--color-on-surface);
23183
+ }
23184
+
22882
23185
  /* ============================================
22883
23186
  * EDGE CASES (T042-T043)
22884
23187
  * ============================================ */
@@ -26468,7 +26771,12 @@ html {
26468
26771
  }
26469
26772
 
26470
26773
  .select-container > .select {
26774
+ display: flex;
26775
+ align-items: center;
26776
+ gap: 0.5rem;
26777
+ padding: 0 0.75rem 0 0.875rem;
26471
26778
  background-image: none;
26779
+ appearance: none;
26472
26780
  }
26473
26781
 
26474
26782
  .select:focus-visible {
@@ -26592,6 +26900,42 @@ html {
26592
26900
  0 16px 40px rgb(15 23 42 / 0.12);
26593
26901
  }
26594
26902
 
26903
+ .select-dropdown[popover] {
26904
+ position: fixed;
26905
+ inset: auto;
26906
+ width: anchor-size(width);
26907
+ min-width: var(--select-anchor-width, 10rem);
26908
+ max-height: 16rem;
26909
+ margin: 0.375rem 0 0 0;
26910
+ padding: 0.375rem;
26911
+ overflow: auto;
26912
+ color: var(--color-on-surface);
26913
+ background-color: var(--color-surface);
26914
+ border: 1px solid var(--color-outline-variant);
26915
+ border-radius: var(--radius-sm);
26916
+ box-shadow:
26917
+ 0 4px 12px rgb(15 23 42 / 0.1),
26918
+ 0 16px 40px rgb(15 23 42 / 0.12);
26919
+ }
26920
+
26921
+ @supports (position-area: bottom) {
26922
+ .select-dropdown[popover] {
26923
+ position-area: bottom span-right;
26924
+ position-try-fallbacks: flip-block;
26925
+ }
26926
+ }
26927
+
26928
+ @supports not (position-area: bottom) {
26929
+ .select-dropdown[popover] {
26930
+ top: anchor(bottom);
26931
+ left: anchor(left);
26932
+ }
26933
+ }
26934
+
26935
+ .select-dropdown[popover]:popover-open {
26936
+ display: grid;
26937
+ }
26938
+
26595
26939
  .select-option {
26596
26940
  display: flex;
26597
26941
  width: 100%;
@@ -29416,19 +29760,7 @@ html {
29416
29760
  width: 100%;
29417
29761
  }
29418
29762
 
29419
- /* Composer state and layout are independent from conversation rows. */
29420
- .chat-composer {
29421
- display: flex;
29422
- flex-direction: column;
29423
- gap: 0.625rem;
29424
- min-width: 0;
29425
- padding: 0.75rem;
29426
- border: 1px solid var(--color-outline-variant);
29427
- border-radius: var(--radius-box, 0.75rem);
29428
- background: var(--color-surface);
29429
- color: var(--color-on-surface);
29430
- }
29431
-
29763
+ /* The controlled helper retains its bounded editor; Core owns composer presentation. */
29432
29764
  .chat-composer .chat-composer-editor {
29433
29765
  box-sizing: border-box;
29434
29766
  width: 100%;
@@ -29438,7 +29770,6 @@ html {
29438
29770
  line-height: 1.5rem;
29439
29771
  }
29440
29772
 
29441
- .chat-composer-actions,
29442
29773
  .chat-composer-attachments {
29443
29774
  display: flex;
29444
29775
  align-items: center;
@@ -29504,6 +29835,6 @@ html {
29504
29835
  font-size: 0.875rem;
29505
29836
  }
29506
29837
 
29507
- .chat-composer-error {
29838
+ .chat-composer .chat-composer-error {
29508
29839
  color: var(--color-error);
29509
29840
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duskmoon-dev/components",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -472,7 +472,7 @@
472
472
  }
473
473
  ],
474
474
  "peerDependencies": {
475
- "@duskmoon-dev/core": ">=1.20.3",
475
+ "@duskmoon-dev/core": ">=1.20.6",
476
476
  "react": ">=19.0.0",
477
477
  "react-dom": ">=19.0.0"
478
478
  },
@@ -485,7 +485,7 @@
485
485
  "ajv-formats": "^3.0.1"
486
486
  },
487
487
  "devDependencies": {
488
- "@duskmoon-dev/core": "1.20.5",
488
+ "@duskmoon-dev/core": "1.20.7",
489
489
  "@testing-library/react": "16.3.2",
490
490
  "@types/react": "19.2.18",
491
491
  "@types/react-dom": "19.2.4",