@c8y/style 1024.15.16 → 1024.16.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/style",
3
- "version": "1024.15.16",
3
+ "version": "1024.16.6",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity GmbH",
6
6
  "description": "Styles for Cumulocity IoT applications",
@@ -1,5 +1,5 @@
1
- @use '../../../variables/index'as *;
2
- @use "../../mixins/tab-focus";
1
+ @use '../../../variables/index' as *;
2
+ @use '../../mixins/tab-focus';
3
3
  /**
4
4
  * C8Y AI Chat - AI chat widget component
5
5
  *
@@ -14,6 +14,7 @@
14
14
  * - Font-size em values (1.2em, 1.5em, 2em): Relative heading sizes
15
15
  * - Line-height values (1.7): Unitless ratio
16
16
  * - Z-index values: Stacking order
17
+ * - Working indicator dot gap (2px): Fine visual spacing smaller than $size-4
17
18
  */
18
19
 
19
20
  c8y-widget-ai-chat-section {
@@ -33,13 +34,14 @@ c8y-widget-ai-chat-section {
33
34
 
34
35
  c8y-agent-chat {
35
36
  width: 100%;
37
+ display: flex;
38
+ flex-direction: column;
36
39
  }
37
40
 
38
41
  .chat-input {
39
42
  display: flex;
40
43
  width: 100%;
41
44
  flex-direction: column;
42
- gap: $size-8;
43
45
  padding: $size-16 $size-16 $size-4 $size-16;
44
46
  background-color: $component-background-default;
45
47
  border-top: 1px solid var(--c8y-root-component-border-color);
@@ -52,12 +54,14 @@ c8y-agent-chat {
52
54
  width: 100%;
53
55
 
54
56
  textarea {
55
- border-radius: 20px !important;
57
+ border-top-right-radius: $size-20 !important;
58
+ border-top-left-radius: $size-20 !important;
56
59
  min-height: $size-40;
57
- padding-top: $size-10;
58
- padding-right: $size-40;
59
- padding-bottom: $size-10;
60
- padding-left: $size-16;
60
+ padding-top: $size-16;
61
+ padding-right: $size-48;
62
+ padding-bottom: $size-16;
63
+ padding-left: $size-24;
64
+ margin-bottom: 0px;
61
65
 
62
66
  &::-webkit-scrollbar {
63
67
  width: unset;
@@ -83,15 +87,42 @@ c8y-agent-chat {
83
87
  }
84
88
  }
85
89
 
90
+ &.chat-input-with-action-bar textarea {
91
+ padding-bottom: calc(var(--c8y-unit-base) * 6);
92
+ }
93
+
94
+ &.chat-input-with-action-bar .chat-action-bar {
95
+ border-top: 1px solid var(--c8y-root-component-border-color);
96
+ }
97
+
86
98
  .chat-input-group-btn {
87
99
  position: absolute;
88
- right: $size-4;
89
- bottom: $size-4;
100
+ right: $size-8;
101
+ top: $size-8;
90
102
 
91
103
  .btn-dot {
92
104
  margin: 0 !important;
93
105
  height: $form-control-height-base !important;
94
106
  border-radius: 50%;
107
+ &:active, &:hover {
108
+ border-radius: 50%;
109
+ }
110
+ }
111
+ }
112
+ }
113
+
114
+ .chat-action-bar {
115
+ width: 100%;
116
+ border: 1px solid var(--c8y-form-control-border-color-default);
117
+ border-top: 0;
118
+ border-bottom-left-radius: $size-20;
119
+ border-bottom-right-radius: $size-20;
120
+ padding: $size-8;
121
+ .btn-dot {
122
+ height: $form-control-height-base !important;
123
+ border-radius: 50%;
124
+ &:active, &:hover {
125
+ border-radius: 50%;
95
126
  }
96
127
  }
97
128
  }
@@ -120,7 +151,7 @@ c8y-agent-chat {
120
151
  align-self: flex-start;
121
152
  min-width: 0;
122
153
  width: 100%;
123
- margin-top: $size-16;
154
+ // margin-top: $size-16;
124
155
  padding: $size-16 $size-24 $size-16 $size-16;
125
156
 
126
157
  h1 {
@@ -198,9 +229,7 @@ c8y-agent-chat {
198
229
  }
199
230
  }
200
231
 
201
-
202
232
  c8y-ai-chat {
203
-
204
233
  // Visually hidden label included when users copy-paste from the chat, e.g. to report issues.
205
234
  .hidden-copy-label {
206
235
  display: block;
@@ -216,11 +245,11 @@ c8y-ai-chat {
216
245
  flex-direction: column;
217
246
  max-width: 100%;
218
247
  min-inline-size: 1rem;
219
- transition: all .35s ease;
248
+ transition: all 0.35s ease;
220
249
 
221
- &:has([aria-expanded="true"]) {
250
+ &:has([aria-expanded='true']) {
222
251
  min-inline-size: 100%;
223
- transition: all .35s ease;
252
+ transition: all 0.35s ease;
224
253
  }
225
254
 
226
255
  &:focus-within {
@@ -252,8 +281,72 @@ c8y-ai-chat {
252
281
  margin-bottom: 0;
253
282
  }
254
283
  }
284
+ }
285
+
286
+ .working-indicator__dots {
287
+ display: inline-flex;
288
+ align-items: baseline;
289
+ gap: 2px;
290
+
291
+ span {
292
+ width: $size-4;
293
+ height: $size-4;
294
+ border-radius: 50%;
295
+ background-color: currentColor;
296
+ opacity: 0.2;
297
+ animation: working-indicator-dot 1.2s ease-in-out infinite;
298
+
299
+ &:nth-child(2) {
300
+ animation-delay: 0.2s;
301
+ }
302
+
303
+ &:nth-child(3) {
304
+ animation-delay: 0.4s;
305
+ }
306
+ }
307
+ }
308
+
309
+ @keyframes working-indicator-dot {
310
+ 0%,
311
+ 80%,
312
+ 100% {
313
+ opacity: 0.2;
314
+ }
315
+
316
+ 40% {
317
+ opacity: 1;
318
+ }
319
+ }
320
+ }
321
+
322
+ c8y-ai-chat-speech-to-text {
323
+ // While recognition is running the microphone turns to the danger color and its icon pulses to
324
+ // signal that the app is actively listening.
325
+ .c8y-speech-to-text-btn--listening {
326
+ color: var(--c8y-palette-status-danger, var(--c8y-brand-primary));
255
327
 
328
+ .c8y-speech-to-text-btn__icon {
329
+ animation: speech-to-text-pulse 1.4s ease-in-out infinite;
330
+ }
256
331
  }
257
332
 
333
+ @keyframes speech-to-text-pulse {
334
+ 0%,
335
+ 100% {
336
+ opacity: 1;
337
+ transform: scale(1);
338
+ }
258
339
 
340
+ 50% {
341
+ opacity: 0.55;
342
+ transform: scale(1.18);
343
+ }
344
+ }
345
+
346
+ // Respect users who prefer reduced motion: keep the color change but drop the pulsing.
347
+ @media (prefers-reduced-motion: reduce) {
348
+ .c8y-speech-to-text-btn--listening .c8y-speech-to-text-btn__icon {
349
+ animation: none;
350
+ }
351
+ }
259
352
  }
@@ -68,6 +68,25 @@ pre {
68
68
  font-size: inherit;
69
69
  overflow-wrap: break-word;
70
70
  }
71
+
72
+ &[data-label]{
73
+ position: relative;
74
+ padding-top: $margin-24;
75
+ border-radius: $btn-border-radius-base;
76
+ &::before{
77
+ content: attr(data-label);
78
+ display: inline-block;
79
+ background-color: $text-muted;
80
+ color: $component-background-default;
81
+ position: absolute;
82
+ top: 0;
83
+ left: 0;
84
+ padding: 0 4px;
85
+ text-transform: uppercase;
86
+ font-size: 10px;
87
+ font-family: $font-family-base;
88
+ }
89
+ }
71
90
  }
72
91
 
73
92
  // pre:has(code) {
@@ -132,6 +132,16 @@
132
132
  .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
133
133
  @include border-radius.border-left-radius(0);
134
134
  }
135
+ // adjust margin and border radius when nested btn-group with dropdown is using cdkTrapFocus
136
+ .btn-group:has(.btn-group + .cdk-visually-hidden:last-child){
137
+ > .btn-group{
138
+ margin-left: -2px;
139
+ > .btn:first-child {
140
+ @include border-radius.border-left-radius(0);
141
+ @include border-radius.border-right-radius($btn-border-radius-base);
142
+ }
143
+ }
144
+ }
135
145
 
136
146
  // On active and open, don't show outline
137
147
  .btn-group .dropdown-toggle:active,
@@ -80,6 +80,11 @@ fieldset.c8y-fieldset {
80
80
  padding-block-end: 0;
81
81
  padding-inline-start: 1.1428571429em;
82
82
  min-inline-size: 100%;
83
+
84
+ &.ai-tool-call__fieldset{
85
+ padding-inline-start: 0.742857em;
86
+ }
87
+
83
88
  &--lg {
84
89
  padding-block-start: 1rem;
85
90
  padding-inline-end: 1.5em;