-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Expand file tree
/
Copy pathUserActionCard.module.css
More file actions
214 lines (188 loc) · 4.27 KB
/
Copy pathUserActionCard.module.css
File metadata and controls
214 lines (188 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
.card {
/* ChatPane width is independent of the viewport — stack head actions off
the card's own inline size via @container, not @media (max-width). */
container-type: inline-size;
container-name: user-action-card;
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
margin: 6px 0;
padding: 11px 12px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-panel);
color: var(--text);
animation: user-action-card-in 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.head {
display: grid;
grid-template-columns: 24px minmax(0, 1fr) auto;
align-items: center;
gap: 9px;
min-width: 0;
}
.icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border-radius: var(--radius-pill);
background: var(--bg-subtle);
color: var(--text-muted);
}
.card[data-tone='danger'] .icon {
background: color-mix(in srgb, var(--red) 9%, transparent);
color: var(--red);
}
.card[data-tone='warning'] .icon {
background: color-mix(in srgb, var(--amber) 10%, transparent);
color: var(--amber);
}
.card[data-tone='brand'] .icon {
background: color-mix(in srgb, var(--accent) 9%, transparent);
color: var(--accent);
}
.title {
min-width: 0;
font-size: 13.5px;
font-weight: 600;
line-height: 1.4;
color: var(--text-strong);
/* Prefer soft breaks over `anywhere` so a squeezed title does not stack
every CJK character on its own line (vertical "模型调用失败…" flash). */
overflow-wrap: break-word;
word-break: normal;
}
.actions {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: 7px;
min-width: 0;
/* Cap so a long localized CTA cannot steal the entire title track. */
max-width: min(100%, 16rem);
}
.actions > * {
min-width: 0;
max-width: 100%;
white-space: normal;
}
.footer {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px 8px;
min-width: 0;
margin-left: 33px;
}
/* ChatPane can be resized independently of the viewport. Let the group shrink
to the card's available inline size and wrap its actions there; using its
max-content width as an inflexible basis lets long localized CTA labels
extend beyond a narrow card even though the footer itself wraps. */
.footerActions {
display: flex;
flex: 1 1 auto;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: 7px;
min-width: 0;
max-width: 100%;
margin-left: auto;
}
.footerActions > * {
min-width: 0;
max-width: 100%;
white-space: normal;
overflow-wrap: anywhere;
}
.detailsToggle {
appearance: none;
align-self: flex-start;
display: inline-flex;
align-items: center;
gap: 5px;
padding: 2px 0;
border: 0;
background: transparent;
color: var(--text-muted);
font: inherit;
font-size: 12px;
line-height: 1.4;
cursor: pointer;
}
.detailsToggle:hover {
color: var(--text);
}
.detailsToggle:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
border-radius: var(--radius-xs);
}
.chevron {
transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.chevronOpen {
transform: rotate(180deg);
}
.details {
margin: 2px 0 0 33px;
padding: 9px 0 1px;
border-top: 1px solid var(--border-soft);
color: var(--text-muted);
font-size: 12.5px;
line-height: 1.55;
overflow-wrap: anywhere;
}
.status {
margin-left: 33px;
color: var(--text-muted);
font-size: 12px;
line-height: 1.45;
}
@keyframes user-action-card-in {
from {
opacity: 0;
transform: translateY(3px);
}
to {
opacity: 1;
transform: none;
}
}
/* Prefer the card's own width: a desktop split with a ~320px ChatPane never
matches viewport max-width:560px, so head CTAs must reflow via @container. */
@container user-action-card (max-width: 420px) {
.head {
grid-template-columns: 24px minmax(0, 1fr);
}
.actions {
grid-column: 2 / -1;
justify-content: flex-start;
max-width: 100%;
}
}
@media (max-width: 560px) {
.head {
grid-template-columns: 24px minmax(0, 1fr);
}
.actions {
grid-column: 2;
justify-content: flex-start;
max-width: 100%;
}
.footerActions {
flex-wrap: wrap;
}
}
@media (prefers-reduced-motion: reduce) {
.card {
animation: none;
}
.chevron {
transition: none;
}
}