@duskmoon-dev/core 1.16.1 → 1.17.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/dist/components/chat.css +406 -0
- package/dist/components/index.css +407 -0
- package/dist/esm/components/chat.js +413 -0
- package/dist/index.css +407 -0
- package/dist/index.min.css +1 -1
- package/package.json +6 -1
package/dist/index.css
CHANGED
|
@@ -4011,6 +4011,413 @@ html {
|
|
|
4011
4011
|
}
|
|
4012
4012
|
}
|
|
4013
4013
|
|
|
4014
|
+
/**
|
|
4015
|
+
* Chat Component Styles
|
|
4016
|
+
* DuskMoonUI - LLM-oriented chat primitives
|
|
4017
|
+
*/
|
|
4018
|
+
|
|
4019
|
+
@layer components {
|
|
4020
|
+
.chat {
|
|
4021
|
+
display: grid;
|
|
4022
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
4023
|
+
column-gap: 0.75rem;
|
|
4024
|
+
align-items: end;
|
|
4025
|
+
padding: 0.25rem 0;
|
|
4026
|
+
}
|
|
4027
|
+
|
|
4028
|
+
.chat-start {
|
|
4029
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
.chat-end {
|
|
4033
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
4034
|
+
}
|
|
4035
|
+
|
|
4036
|
+
.chat-avatar {
|
|
4037
|
+
grid-row: 1 / span 999;
|
|
4038
|
+
grid-column: 1;
|
|
4039
|
+
align-self: start;
|
|
4040
|
+
justify-self: start;
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
.chat-end .chat-avatar {
|
|
4044
|
+
grid-column: 2;
|
|
4045
|
+
justify-self: end;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
.chat > :not(.chat-avatar) {
|
|
4049
|
+
grid-column: 2;
|
|
4050
|
+
justify-self: start;
|
|
4051
|
+
max-width: 100%;
|
|
4052
|
+
margin-bottom: 0.25rem;
|
|
4053
|
+
}
|
|
4054
|
+
|
|
4055
|
+
.chat-end > :not(.chat-avatar) {
|
|
4056
|
+
grid-column: 1;
|
|
4057
|
+
justify-self: end;
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
.chat-header,
|
|
4061
|
+
.chat-footer {
|
|
4062
|
+
color: var(--color-on-surface-variant);
|
|
4063
|
+
font-size: 0.75rem;
|
|
4064
|
+
line-height: 1rem;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
.chat-header {
|
|
4068
|
+
margin-bottom: 0.125rem;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
.chat-footer {
|
|
4072
|
+
margin-top: 0.125rem;
|
|
4073
|
+
margin-bottom: 0;
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
.chat-bubble {
|
|
4077
|
+
--chat-bubble-bg: var(--color-surface-container-highest);
|
|
4078
|
+
--chat-bubble-fg: var(--color-on-surface);
|
|
4079
|
+
|
|
4080
|
+
position: relative;
|
|
4081
|
+
max-width: min(80ch, 100%);
|
|
4082
|
+
padding: 0.625rem 0.875rem;
|
|
4083
|
+
border-radius: 1rem;
|
|
4084
|
+
background-color: var(--chat-bubble-bg);
|
|
4085
|
+
color: var(--chat-bubble-fg);
|
|
4086
|
+
box-shadow: inset 0 0 0 1px var(--color-outline-variant);
|
|
4087
|
+
font-size: 0.875rem;
|
|
4088
|
+
line-height: 1.45;
|
|
4089
|
+
overflow-wrap: anywhere;
|
|
4090
|
+
word-break: break-word;
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
.chat-start .chat-bubble::before,
|
|
4094
|
+
.chat-end .chat-bubble::before,
|
|
4095
|
+
.chat-start .chat-bubble::after,
|
|
4096
|
+
.chat-end .chat-bubble::after {
|
|
4097
|
+
content: "";
|
|
4098
|
+
position: absolute;
|
|
4099
|
+
top: 0;
|
|
4100
|
+
clip-path: polygon(0 0, 100% 0, 100% 100%);
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
.chat-start .chat-bubble::before {
|
|
4104
|
+
left: -0.625rem;
|
|
4105
|
+
width: 1rem;
|
|
4106
|
+
height: 1rem;
|
|
4107
|
+
background-color: var(--color-outline-variant);
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
.chat-start .chat-bubble::after {
|
|
4111
|
+
left: -0.5rem;
|
|
4112
|
+
width: calc(1rem - 2px);
|
|
4113
|
+
height: calc(1rem - 2px);
|
|
4114
|
+
top: 1px;
|
|
4115
|
+
background-color: var(--chat-bubble-bg);
|
|
4116
|
+
}
|
|
4117
|
+
|
|
4118
|
+
.chat-start .chat-bubble {
|
|
4119
|
+
border-top-left-radius: 0;
|
|
4120
|
+
}
|
|
4121
|
+
|
|
4122
|
+
.chat-end .chat-bubble::before {
|
|
4123
|
+
right: -0.625rem;
|
|
4124
|
+
width: 1rem;
|
|
4125
|
+
height: 1rem;
|
|
4126
|
+
background-color: var(--color-outline-variant);
|
|
4127
|
+
transform: scaleX(-1);
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
.chat-end .chat-bubble::after {
|
|
4131
|
+
right: -0.5rem;
|
|
4132
|
+
width: calc(1rem - 2px);
|
|
4133
|
+
height: calc(1rem - 2px);
|
|
4134
|
+
top: 1px;
|
|
4135
|
+
background-color: var(--chat-bubble-bg);
|
|
4136
|
+
transform: scaleX(-1);
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
.chat-end .chat-bubble {
|
|
4140
|
+
border-top-right-radius: 0;
|
|
4141
|
+
}
|
|
4142
|
+
|
|
4143
|
+
.chat-bubble-primary {
|
|
4144
|
+
--chat-bubble-bg: var(--color-primary-container);
|
|
4145
|
+
--chat-bubble-fg: var(--color-on-primary-container);
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4148
|
+
.chat-bubble-secondary {
|
|
4149
|
+
--chat-bubble-bg: var(--color-secondary-container);
|
|
4150
|
+
--chat-bubble-fg: var(--color-on-secondary-container);
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
.chat-bubble-tertiary {
|
|
4154
|
+
--chat-bubble-bg: var(--color-tertiary-container);
|
|
4155
|
+
--chat-bubble-fg: var(--color-on-tertiary-container);
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4158
|
+
.chat-bubble-info {
|
|
4159
|
+
--chat-bubble-bg: var(--color-info-container);
|
|
4160
|
+
--chat-bubble-fg: var(--color-on-info-container);
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4163
|
+
.chat-bubble-success {
|
|
4164
|
+
--chat-bubble-bg: var(--color-success-container);
|
|
4165
|
+
--chat-bubble-fg: var(--color-on-success-container);
|
|
4166
|
+
}
|
|
4167
|
+
|
|
4168
|
+
.chat-bubble-warning {
|
|
4169
|
+
--chat-bubble-bg: var(--color-warning-container);
|
|
4170
|
+
--chat-bubble-fg: var(--color-on-warning-container);
|
|
4171
|
+
}
|
|
4172
|
+
|
|
4173
|
+
.chat-bubble-error {
|
|
4174
|
+
--chat-bubble-bg: var(--color-error-container);
|
|
4175
|
+
--chat-bubble-fg: var(--color-on-error-container);
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4178
|
+
.chat-bubble-filled.chat-bubble-primary {
|
|
4179
|
+
--chat-bubble-bg: var(--color-primary);
|
|
4180
|
+
--chat-bubble-fg: var(--color-primary-content);
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
.chat-bubble-filled.chat-bubble-secondary {
|
|
4184
|
+
--chat-bubble-bg: var(--color-secondary);
|
|
4185
|
+
--chat-bubble-fg: var(--color-secondary-content);
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
.chat-bubble-filled.chat-bubble-tertiary {
|
|
4189
|
+
--chat-bubble-bg: var(--color-tertiary);
|
|
4190
|
+
--chat-bubble-fg: var(--color-tertiary-content);
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
.chat-bubble-filled.chat-bubble-info {
|
|
4194
|
+
--chat-bubble-bg: var(--color-info);
|
|
4195
|
+
--chat-bubble-fg: var(--color-info-content);
|
|
4196
|
+
}
|
|
4197
|
+
|
|
4198
|
+
.chat-bubble-filled.chat-bubble-success {
|
|
4199
|
+
--chat-bubble-bg: var(--color-success);
|
|
4200
|
+
--chat-bubble-fg: var(--color-success-content);
|
|
4201
|
+
}
|
|
4202
|
+
|
|
4203
|
+
.chat-bubble-filled.chat-bubble-warning {
|
|
4204
|
+
--chat-bubble-bg: var(--color-warning);
|
|
4205
|
+
--chat-bubble-fg: var(--color-warning-content);
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4208
|
+
.chat-bubble-filled.chat-bubble-error {
|
|
4209
|
+
--chat-bubble-bg: var(--color-error);
|
|
4210
|
+
--chat-bubble-fg: var(--color-error-content);
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4213
|
+
.chat-bubble-xs {
|
|
4214
|
+
padding: 0.375rem 0.625rem;
|
|
4215
|
+
font-size: 0.75rem;
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
.chat-bubble-sm {
|
|
4219
|
+
padding: 0.5rem 0.75rem;
|
|
4220
|
+
font-size: 0.8125rem;
|
|
4221
|
+
}
|
|
4222
|
+
|
|
4223
|
+
.chat-bubble-md {
|
|
4224
|
+
padding: 0.625rem 0.875rem;
|
|
4225
|
+
font-size: 0.875rem;
|
|
4226
|
+
}
|
|
4227
|
+
|
|
4228
|
+
.chat-bubble-lg {
|
|
4229
|
+
padding: 0.875rem 1.125rem;
|
|
4230
|
+
font-size: 1rem;
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4233
|
+
.chat-reasoning,
|
|
4234
|
+
.chat-tool {
|
|
4235
|
+
width: min(80ch, 100%);
|
|
4236
|
+
border: 1px solid var(--color-outline);
|
|
4237
|
+
border-radius: var(--radius-sm);
|
|
4238
|
+
background-color: var(--color-surface-container-low);
|
|
4239
|
+
color: var(--color-on-surface);
|
|
4240
|
+
font-size: 0.8125rem;
|
|
4241
|
+
line-height: 1.45;
|
|
4242
|
+
overflow: hidden;
|
|
4243
|
+
}
|
|
4244
|
+
|
|
4245
|
+
.chat-reasoning > summary,
|
|
4246
|
+
.chat-tool > summary {
|
|
4247
|
+
cursor: pointer;
|
|
4248
|
+
list-style-position: inside;
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4251
|
+
.chat-reasoning > summary {
|
|
4252
|
+
padding: 0.5rem 0.75rem;
|
|
4253
|
+
color: var(--color-on-surface-variant);
|
|
4254
|
+
font-weight: 500;
|
|
4255
|
+
}
|
|
4256
|
+
|
|
4257
|
+
.chat-reasoning > :not(summary) {
|
|
4258
|
+
padding: 0 0.75rem 0.75rem;
|
|
4259
|
+
color: var(--color-on-surface-variant);
|
|
4260
|
+
font-style: italic;
|
|
4261
|
+
}
|
|
4262
|
+
|
|
4263
|
+
.chat-tool-header {
|
|
4264
|
+
display: flex;
|
|
4265
|
+
align-items: center;
|
|
4266
|
+
gap: 0.5rem;
|
|
4267
|
+
padding: 0.5rem 0.75rem;
|
|
4268
|
+
color: var(--color-on-surface);
|
|
4269
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
4270
|
+
font-size: 0.75rem;
|
|
4271
|
+
font-weight: 600;
|
|
4272
|
+
}
|
|
4273
|
+
|
|
4274
|
+
.chat-tool-status {
|
|
4275
|
+
display: inline-flex;
|
|
4276
|
+
align-items: center;
|
|
4277
|
+
min-height: 1.25rem;
|
|
4278
|
+
padding: 0.125rem 0.5rem;
|
|
4279
|
+
border-radius: 999px;
|
|
4280
|
+
margin-left: auto;
|
|
4281
|
+
font-family: inherit;
|
|
4282
|
+
font-size: 0.6875rem;
|
|
4283
|
+
font-weight: 600;
|
|
4284
|
+
line-height: 1;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
.chat-tool-call,
|
|
4288
|
+
.chat-tool-result {
|
|
4289
|
+
padding: 0.75rem;
|
|
4290
|
+
border-top: 1px solid var(--color-outline);
|
|
4291
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
4292
|
+
font-size: 0.75rem;
|
|
4293
|
+
overflow-x: auto;
|
|
4294
|
+
}
|
|
4295
|
+
|
|
4296
|
+
.chat-tool-result {
|
|
4297
|
+
background-color: color-mix(in oklch, var(--color-surface-container) 65%, transparent);
|
|
4298
|
+
}
|
|
4299
|
+
|
|
4300
|
+
.chat-tool-pending .chat-tool-status {
|
|
4301
|
+
border: 1px solid var(--color-outline);
|
|
4302
|
+
color: var(--color-on-surface-variant);
|
|
4303
|
+
}
|
|
4304
|
+
|
|
4305
|
+
.chat-tool-running .chat-tool-status {
|
|
4306
|
+
background-color: var(--color-info-container);
|
|
4307
|
+
color: var(--color-on-info-container);
|
|
4308
|
+
}
|
|
4309
|
+
|
|
4310
|
+
.chat-tool-running .chat-tool-header::before {
|
|
4311
|
+
content: "";
|
|
4312
|
+
width: 0.875rem;
|
|
4313
|
+
height: 0.875rem;
|
|
4314
|
+
border: 2px solid currentColor;
|
|
4315
|
+
border-top-color: transparent;
|
|
4316
|
+
border-radius: 999px;
|
|
4317
|
+
animation: chat-tool-spin 800ms linear infinite;
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
.chat-tool-success .chat-tool-status {
|
|
4321
|
+
background-color: var(--color-success-container);
|
|
4322
|
+
color: var(--color-on-success-container);
|
|
4323
|
+
}
|
|
4324
|
+
|
|
4325
|
+
.chat-tool-error .chat-tool-status {
|
|
4326
|
+
background-color: var(--color-error-container);
|
|
4327
|
+
color: var(--color-on-error-container);
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4330
|
+
.chat-typing {
|
|
4331
|
+
display: inline-flex;
|
|
4332
|
+
align-items: center;
|
|
4333
|
+
gap: 0.25rem;
|
|
4334
|
+
min-width: 2.25rem;
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
.chat-typing::before,
|
|
4338
|
+
.chat-typing::after,
|
|
4339
|
+
.chat-typing span {
|
|
4340
|
+
content: "";
|
|
4341
|
+
width: 0.375rem;
|
|
4342
|
+
height: 0.375rem;
|
|
4343
|
+
border-radius: 999px;
|
|
4344
|
+
background-color: currentColor;
|
|
4345
|
+
opacity: 0.55;
|
|
4346
|
+
animation: chat-typing-dot 1.4s ease-in-out infinite;
|
|
4347
|
+
}
|
|
4348
|
+
|
|
4349
|
+
.chat-typing span {
|
|
4350
|
+
animation-delay: 150ms;
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
.chat-typing::after {
|
|
4354
|
+
animation-delay: 300ms;
|
|
4355
|
+
}
|
|
4356
|
+
|
|
4357
|
+
.chat-bubble-streaming::after {
|
|
4358
|
+
content: "";
|
|
4359
|
+
display: inline-block;
|
|
4360
|
+
width: 1px;
|
|
4361
|
+
height: 1em;
|
|
4362
|
+
margin-left: 0.25rem;
|
|
4363
|
+
background-color: currentColor;
|
|
4364
|
+
vertical-align: -0.125em;
|
|
4365
|
+
animation: chat-stream-caret 1s step-end infinite;
|
|
4366
|
+
}
|
|
4367
|
+
|
|
4368
|
+
.chat-reasoning > summary:focus-visible,
|
|
4369
|
+
.chat-tool > summary:focus-visible {
|
|
4370
|
+
outline: none;
|
|
4371
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 20%, transparent);
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4374
|
+
@keyframes chat-typing-dot {
|
|
4375
|
+
0%,
|
|
4376
|
+
80%,
|
|
4377
|
+
100% {
|
|
4378
|
+
opacity: 0.45;
|
|
4379
|
+
transform: translateY(0);
|
|
4380
|
+
}
|
|
4381
|
+
|
|
4382
|
+
40% {
|
|
4383
|
+
opacity: 1;
|
|
4384
|
+
transform: translateY(-0.1875rem);
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
|
|
4388
|
+
@keyframes chat-stream-caret {
|
|
4389
|
+
0%,
|
|
4390
|
+
49% {
|
|
4391
|
+
opacity: 1;
|
|
4392
|
+
}
|
|
4393
|
+
|
|
4394
|
+
50%,
|
|
4395
|
+
100% {
|
|
4396
|
+
opacity: 0;
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
@keyframes chat-tool-spin {
|
|
4401
|
+
to {
|
|
4402
|
+
transform: rotate(360deg);
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4405
|
+
|
|
4406
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4407
|
+
.chat-typing::before,
|
|
4408
|
+
.chat-typing::after,
|
|
4409
|
+
.chat-typing span,
|
|
4410
|
+
.chat-bubble-streaming::after,
|
|
4411
|
+
.chat-tool-running .chat-tool-header::before {
|
|
4412
|
+
animation: none;
|
|
4413
|
+
}
|
|
4414
|
+
|
|
4415
|
+
.chat-bubble-streaming::after {
|
|
4416
|
+
opacity: 1;
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
|
|
4014
4421
|
/**
|
|
4015
4422
|
* Chip Component Styles
|
|
4016
4423
|
* DuskMoonUI - Material Design 3 inspired chip system
|