gbs-add-block 1.2.8 → 1.2.9

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.
@@ -0,0 +1,417 @@
1
+ /*
2
+ * Combobox styles (Select and MultiSelect).
3
+ *
4
+ * Tokens default to the DataGrid's --dg-* variables when that stylesheet is
5
+ * present, so both components share one theme, and fall back to the same
6
+ * palette when used on their own. Rules live in the `components` layer, so
7
+ * utility classes passed through `className` / `classNames` override them.
8
+ */
9
+ @layer theme, base, components, utilities;
10
+
11
+ @layer components {
12
+ .cb-root {
13
+ --cb-bg: var(--dg-bg, light-dark(#ffffff, #0b0b0e));
14
+ --cb-fg: var(--dg-fg, light-dark(#18181b, #f4f4f5));
15
+ --cb-muted: var(--dg-muted, light-dark(#71717a, #a1a1aa));
16
+ --cb-border: var(--dg-border, light-dark(#e4e4e7, #27272a));
17
+ --cb-hover: var(--dg-hover, light-dark(#f4f4f5, #1f1f23));
18
+ --cb-input-bg: var(--dg-input-bg, light-dark(#ffffff, #121216));
19
+ --cb-accent: var(--dg-accent, light-dark(#2563eb, #60a5fa));
20
+ --cb-accent-fg: var(--dg-accent-fg, light-dark(#ffffff, #0b1220));
21
+ --cb-accent-soft: var(--dg-accent-soft, light-dark(#eff6ff, #172554));
22
+ --cb-accent-strong: var(--dg-accent-strong, light-dark(#1d4ed8, #bfdbfe));
23
+ --cb-focus: var(--dg-focus, light-dark(#2563eb, #60a5fa));
24
+ --cb-danger: var(--dg-danger, light-dark(#dc2626, #f87171));
25
+ --cb-shadow: var(--dg-shadow, 0 10px 30px -8px light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.6)));
26
+ --cb-radius: var(--dg-radius, 8px);
27
+ --cb-font-size: var(--dg-font-size, 13px);
28
+ --cb-height: 36px;
29
+ --cb-px: 10px;
30
+
31
+ color-scheme: inherit;
32
+ position: relative;
33
+ display: flex;
34
+ flex-direction: column;
35
+ gap: 4px;
36
+ width: 100%;
37
+ min-width: 0;
38
+ font-size: var(--cb-font-size);
39
+ line-height: 1.4;
40
+ color: var(--cb-fg);
41
+ }
42
+
43
+ :where(.dark, [data-theme="dark"]) .cb-root {
44
+ color-scheme: dark;
45
+ }
46
+ :where(.light, [data-theme="light"]) .cb-root {
47
+ color-scheme: light;
48
+ }
49
+
50
+ :where(.cb-root, .cb-popover) *,
51
+ :where(.cb-root, .cb-popover) *::before,
52
+ :where(.cb-root, .cb-popover) *::after {
53
+ box-sizing: border-box;
54
+ }
55
+
56
+ .cb-root[data-size="sm"] {
57
+ --cb-height: 30px;
58
+ --cb-font-size: 12px;
59
+ --cb-px: 8px;
60
+ }
61
+ .cb-root[data-size="lg"] {
62
+ --cb-height: 44px;
63
+ --cb-font-size: 14px;
64
+ --cb-px: 12px;
65
+ }
66
+
67
+ .cb-label {
68
+ font-weight: 500;
69
+ }
70
+ .cb-label[data-required]::after {
71
+ content: " *";
72
+ color: var(--cb-danger);
73
+ }
74
+ .cb-description {
75
+ color: var(--cb-muted);
76
+ font-size: 0.92em;
77
+ }
78
+ .cb-error {
79
+ color: var(--cb-danger);
80
+ font-size: 0.92em;
81
+ }
82
+
83
+ /* -------------------------------------------------------------- trigger */
84
+
85
+ .cb-control {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 6px;
89
+ width: 100%;
90
+ min-height: var(--cb-height);
91
+ padding: 3px var(--cb-px);
92
+ border: 1px solid var(--cb-border);
93
+ border-radius: var(--cb-radius);
94
+ background: var(--cb-input-bg);
95
+ color: inherit;
96
+ font: inherit;
97
+ text-align: start;
98
+ cursor: pointer;
99
+ }
100
+ .cb-control:hover:not([data-disabled]) {
101
+ border-color: color-mix(in oklab, var(--cb-border), var(--cb-fg) 25%);
102
+ }
103
+ .cb-control:focus-visible,
104
+ .cb-root[data-state="open"] .cb-control {
105
+ outline: 2px solid var(--cb-focus);
106
+ outline-offset: -1px;
107
+ }
108
+ .cb-control[data-invalid] {
109
+ border-color: var(--cb-danger);
110
+ }
111
+ .cb-control[data-invalid]:focus-visible,
112
+ .cb-root[data-invalid][data-state="open"] .cb-control {
113
+ outline-color: var(--cb-danger);
114
+ }
115
+ .cb-control[data-disabled] {
116
+ opacity: 0.55;
117
+ cursor: not-allowed;
118
+ }
119
+
120
+ .cb-value {
121
+ flex: 1 1 auto;
122
+ min-width: 0;
123
+ overflow: hidden;
124
+ text-overflow: ellipsis;
125
+ white-space: nowrap;
126
+ }
127
+ .cb-placeholder {
128
+ color: var(--cb-muted);
129
+ }
130
+ .cb-value-icon {
131
+ display: inline-flex;
132
+ margin-inline-end: 6px;
133
+ vertical-align: -2px;
134
+ color: var(--cb-muted);
135
+ }
136
+
137
+ .cb-tags {
138
+ display: flex;
139
+ flex: 1 1 auto;
140
+ flex-wrap: wrap;
141
+ align-items: center;
142
+ gap: 4px;
143
+ min-width: 0;
144
+ }
145
+ .cb-tag {
146
+ display: inline-flex;
147
+ align-items: center;
148
+ gap: 2px;
149
+ max-width: 100%;
150
+ padding-inline: 8px 3px;
151
+ border-radius: 999px;
152
+ background: var(--cb-accent-soft);
153
+ color: var(--cb-accent-strong);
154
+ font-size: 0.92em;
155
+ line-height: 20px;
156
+ }
157
+ .cb-tag-label {
158
+ overflow: hidden;
159
+ text-overflow: ellipsis;
160
+ white-space: nowrap;
161
+ }
162
+ .cb-tag-remove {
163
+ display: inline-grid;
164
+ place-items: center;
165
+ width: 16px;
166
+ height: 16px;
167
+ padding: 0;
168
+ border: 0;
169
+ border-radius: 50%;
170
+ background: transparent;
171
+ color: inherit;
172
+ cursor: pointer;
173
+ }
174
+ .cb-tag-remove:hover {
175
+ background: color-mix(in oklab, var(--cb-accent-strong), transparent 85%);
176
+ }
177
+ .cb-tag-overflow {
178
+ color: var(--cb-muted);
179
+ font-size: 0.92em;
180
+ white-space: nowrap;
181
+ }
182
+
183
+ .cb-actions {
184
+ display: flex;
185
+ flex: none;
186
+ align-items: center;
187
+ gap: 2px;
188
+ color: var(--cb-muted);
189
+ }
190
+ .cb-icon-button {
191
+ display: inline-grid;
192
+ place-items: center;
193
+ width: 22px;
194
+ height: 22px;
195
+ padding: 0;
196
+ border: 0;
197
+ border-radius: 4px;
198
+ background: transparent;
199
+ color: inherit;
200
+ cursor: pointer;
201
+ }
202
+ .cb-icon-button:hover {
203
+ background: var(--cb-hover);
204
+ color: var(--cb-fg);
205
+ }
206
+ .cb-icon-button:focus-visible {
207
+ outline: 2px solid var(--cb-focus);
208
+ outline-offset: 1px;
209
+ }
210
+ .cb-chevron {
211
+ transition: transform 120ms ease;
212
+ }
213
+ .cb-root[data-state="open"] .cb-chevron {
214
+ transform: rotate(180deg);
215
+ }
216
+ @media (prefers-reduced-motion: reduce) {
217
+ .cb-chevron {
218
+ transition: none;
219
+ }
220
+ }
221
+
222
+ /* -------------------------------------------------------------- popover */
223
+
224
+ .cb-popover {
225
+ position: fixed;
226
+ inset: auto;
227
+ margin: 0;
228
+ padding: 0;
229
+ overflow: hidden;
230
+ border: 1px solid var(--cb-border);
231
+ border-radius: var(--cb-radius);
232
+ background: var(--cb-bg);
233
+ color: var(--cb-fg);
234
+ box-shadow: var(--cb-shadow);
235
+ font-size: var(--cb-font-size);
236
+ }
237
+ .cb-search {
238
+ display: flex;
239
+ align-items: center;
240
+ gap: 6px;
241
+ padding: 6px 10px;
242
+ border-bottom: 1px solid var(--cb-border);
243
+ color: var(--cb-muted);
244
+ }
245
+ .cb-search input {
246
+ width: 100%;
247
+ min-width: 0;
248
+ border: 0;
249
+ outline: 0;
250
+ background: transparent;
251
+ color: var(--cb-fg);
252
+ font: inherit;
253
+ }
254
+
255
+ .cb-list {
256
+ position: relative;
257
+ overflow: auto;
258
+ overscroll-behavior: contain;
259
+ padding: 4px;
260
+ outline: none;
261
+ }
262
+ .cb-list:focus-visible {
263
+ outline: 2px solid var(--cb-focus);
264
+ outline-offset: -2px;
265
+ }
266
+ .cb-list[data-virtual] .cb-item,
267
+ .cb-list[data-virtual] .cb-group {
268
+ position: absolute;
269
+ inset-inline: 4px;
270
+ }
271
+
272
+ .cb-group {
273
+ display: flex;
274
+ align-items: center;
275
+ padding: 6px 8px 2px;
276
+ color: var(--cb-muted);
277
+ font-size: 0.85em;
278
+ font-weight: 600;
279
+ letter-spacing: 0.04em;
280
+ text-transform: uppercase;
281
+ }
282
+
283
+ .cb-item {
284
+ display: flex;
285
+ align-items: center;
286
+ gap: 8px;
287
+ width: 100%;
288
+ padding: 6px 8px;
289
+ border: 0;
290
+ border-radius: 6px;
291
+ background: transparent;
292
+ color: inherit;
293
+ font: inherit;
294
+ text-align: start;
295
+ cursor: pointer;
296
+ }
297
+ .cb-item[data-active] {
298
+ background: var(--cb-hover);
299
+ }
300
+ .cb-item[data-selected] {
301
+ color: var(--cb-accent-strong);
302
+ font-weight: 500;
303
+ }
304
+ .cb-item[data-disabled] {
305
+ opacity: 0.45;
306
+ cursor: not-allowed;
307
+ }
308
+ .cb-item-check {
309
+ flex: none;
310
+ width: 16px;
311
+ color: var(--cb-accent);
312
+ opacity: 0;
313
+ }
314
+ .cb-item[data-selected] .cb-item-check {
315
+ opacity: 1;
316
+ }
317
+ .cb-item-icon {
318
+ flex: none;
319
+ display: inline-flex;
320
+ color: var(--cb-muted);
321
+ }
322
+ .cb-item-body {
323
+ flex: 1 1 auto;
324
+ min-width: 0;
325
+ }
326
+ .cb-item-label {
327
+ overflow: hidden;
328
+ text-overflow: ellipsis;
329
+ white-space: nowrap;
330
+ }
331
+ .cb-item-description {
332
+ overflow: hidden;
333
+ color: var(--cb-muted);
334
+ font-size: 0.9em;
335
+ text-overflow: ellipsis;
336
+ white-space: nowrap;
337
+ }
338
+ .cb-mark {
339
+ background: color-mix(in oklab, var(--cb-accent), transparent 82%);
340
+ border-radius: 2px;
341
+ color: inherit;
342
+ font-weight: 600;
343
+ }
344
+
345
+ .cb-empty,
346
+ .cb-status {
347
+ display: flex;
348
+ align-items: center;
349
+ justify-content: center;
350
+ gap: 8px;
351
+ padding: 16px 8px;
352
+ color: var(--cb-muted);
353
+ }
354
+ .cb-footer {
355
+ display: flex;
356
+ align-items: center;
357
+ justify-content: space-between;
358
+ gap: 8px;
359
+ padding: 4px 6px;
360
+ border-top: 1px solid var(--cb-border);
361
+ }
362
+ .cb-link-button {
363
+ padding: 4px 6px;
364
+ border: 0;
365
+ border-radius: 4px;
366
+ background: none;
367
+ color: var(--cb-accent);
368
+ font: inherit;
369
+ cursor: pointer;
370
+ }
371
+ .cb-link-button:hover {
372
+ background: var(--cb-hover);
373
+ }
374
+ .cb-link-button:disabled {
375
+ opacity: 0.5;
376
+ cursor: default;
377
+ }
378
+ .cb-footer-count {
379
+ color: var(--cb-muted);
380
+ }
381
+
382
+ .cb-spinner {
383
+ animation: cb-spin 0.7s linear infinite;
384
+ }
385
+ @keyframes cb-spin {
386
+ to {
387
+ transform: rotate(360deg);
388
+ }
389
+ }
390
+ @media (prefers-reduced-motion: reduce) {
391
+ .cb-spinner {
392
+ animation-duration: 2s;
393
+ }
394
+ }
395
+
396
+ .cb-sr-only {
397
+ position: absolute;
398
+ width: 1px;
399
+ height: 1px;
400
+ margin: -1px;
401
+ padding: 0;
402
+ overflow: hidden;
403
+ clip-path: inset(50%);
404
+ white-space: nowrap;
405
+ border: 0;
406
+ }
407
+
408
+ @media (forced-colors: active) {
409
+ .cb-item[data-active] {
410
+ outline: 1px solid Highlight;
411
+ }
412
+ .cb-mark {
413
+ background: Highlight;
414
+ color: HighlightText;
415
+ }
416
+ }
417
+ }