@cboxdk/cbox-ui 0.11.2 → 0.12.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/README.md +30 -1
- package/dist/index.d.ts +229 -2
- package/dist/index.js +378 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/tokens/cbox.css +7 -0
- package/tokens/controls.css +289 -0
- package/tokens/shell.css +7 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cboxdk/cbox-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Cbox shared UI — layout primitives, design tokens, and brand assets used across every Cbox-family app (id, cortex, atlas, track, …).",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"./tokens": "./tokens/cbox.css",
|
|
43
43
|
"./tailwind": "./tailwind.preset.js",
|
|
44
44
|
"./assets/*": "./assets/*",
|
|
45
|
-
"./shell.css": "./tokens/shell.css"
|
|
45
|
+
"./shell.css": "./tokens/shell.css",
|
|
46
|
+
"./controls.css": "./tokens/controls.css"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "tsup",
|
package/tokens/cbox.css
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* The shell's own stylesheet (CboxShell). */
|
|
2
2
|
@import './shell.css';
|
|
3
|
+
/* Form controls and the dialog (Button, Field, Input, Checkbox, RadioGroup, Switch, Dialog). */
|
|
4
|
+
@import './controls.css';
|
|
3
5
|
|
|
4
6
|
/* Cbox colour tokens — cbox-ui structure, warmed toward cbox.dk's cream/ink palette
|
|
5
7
|
* so the products share temperature with the brand site (and aren't a Linear clone).
|
|
@@ -54,6 +56,9 @@
|
|
|
54
56
|
|
|
55
57
|
--border: oklch(0.82 0.020 85);
|
|
56
58
|
--border-strong: oklch(0.71 0.024 85);
|
|
59
|
+
/* The stroke of a control whose stroke is its only boundary (an input, a checkbox, the plain
|
|
60
|
+
* button): 3:1 on a card and the background (WCAG 2.2 SC 1.4.11). */
|
|
61
|
+
--control-border: oklch(0.62 0.022 85);
|
|
57
62
|
--input: oklch(0.905 0.014 85);
|
|
58
63
|
--ring: oklch(0.5 0.17 258);
|
|
59
64
|
|
|
@@ -126,6 +131,7 @@
|
|
|
126
131
|
|
|
127
132
|
--border: oklch(0.39 0.016 80);
|
|
128
133
|
--border-strong: oklch(0.50 0.018 80);
|
|
134
|
+
--control-border: oklch(0.56 0.018 80);
|
|
129
135
|
--input: oklch(0.32 0.013 80);
|
|
130
136
|
--ring: oklch(0.65 0.18 258);
|
|
131
137
|
|
|
@@ -209,6 +215,7 @@
|
|
|
209
215
|
|
|
210
216
|
--color-border: var(--border);
|
|
211
217
|
--color-border-strong: var(--border-strong);
|
|
218
|
+
--color-control-border: var(--control-border);
|
|
212
219
|
--color-input: var(--input);
|
|
213
220
|
--color-ring: var(--ring);
|
|
214
221
|
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/* Form controls and the dialog: Button, Field, Input, Textarea, Checkbox, RadioGroup, Switch,
|
|
2
|
+
* Spinner, Dialog. Plain CSS on the shared tokens, so it needs no Tailwind scan of the package.
|
|
3
|
+
*
|
|
4
|
+
* Everything sits in `@layer components`. In a Tailwind v4 app that layer is already ordered
|
|
5
|
+
* under `utilities`, so a `className="w-full"` on a Button wins over the rule here; without
|
|
6
|
+
* Tailwind the layer still sits under the app's own unlayered CSS.
|
|
7
|
+
*
|
|
8
|
+
* Classes are `cbx-ui-*` so they never meet an app's own `.btn`, `.input` or `.cbx-dialog`
|
|
9
|
+
* while it moves over. */
|
|
10
|
+
|
|
11
|
+
@layer components {
|
|
12
|
+
.cbx-ui-btn,
|
|
13
|
+
.cbx-ui-input,
|
|
14
|
+
.cbx-ui-check,
|
|
15
|
+
.cbx-ui-radio,
|
|
16
|
+
.cbx-ui-switch,
|
|
17
|
+
.cbx-ui-dialog,
|
|
18
|
+
.cbx-ui-iconbtn {
|
|
19
|
+
--cbx-ui-ease: cubic-bezier(.4, 0, .2, 1);
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ── Button: 32px, 8px radius, 13px/500. sm 28px, lg 42px. */
|
|
24
|
+
.cbx-ui-btn {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
gap: 6px;
|
|
29
|
+
height: 32px;
|
|
30
|
+
padding: 0 12px;
|
|
31
|
+
border: 1px solid transparent;
|
|
32
|
+
border-radius: var(--radius-md, 8px);
|
|
33
|
+
background: transparent;
|
|
34
|
+
color: var(--foreground);
|
|
35
|
+
font: inherit;
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
line-height: 1;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
transition: background-color 150ms var(--cbx-ui-ease), border-color 150ms var(--cbx-ui-ease), box-shadow 150ms var(--cbx-ui-ease), color 150ms var(--cbx-ui-ease);
|
|
43
|
+
}
|
|
44
|
+
.cbx-ui-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
45
|
+
.cbx-ui-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
46
|
+
/* Disabled but focusable (a link styled as a button): reachable, and a click is a no-op. */
|
|
47
|
+
.cbx-ui-btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
|
|
48
|
+
.cbx-ui-btn:active:not(:disabled):not([aria-disabled='true']) { transform: translateY(0.5px); }
|
|
49
|
+
.cbx-ui-btn-glyph { display: inline-flex; flex-shrink: 0; }
|
|
50
|
+
.cbx-ui-btn-glyph > svg { width: 16px; height: 16px; }
|
|
51
|
+
|
|
52
|
+
.cbx-ui-btn--primary {
|
|
53
|
+
background: var(--primary);
|
|
54
|
+
color: var(--primary-foreground);
|
|
55
|
+
box-shadow: inset 0 1px 0 color-mix(in oklch, #fff 22%, transparent), 0 1px 2px color-mix(in oklch, var(--primary) 42%, transparent);
|
|
56
|
+
}
|
|
57
|
+
.cbx-ui-btn--primary:hover:not(:disabled):not([aria-disabled='true']) {
|
|
58
|
+
background: var(--accent);
|
|
59
|
+
box-shadow: inset 0 1px 0 color-mix(in oklch, #fff 26%, transparent), 0 3px 10px color-mix(in oklch, var(--primary) 45%, transparent);
|
|
60
|
+
}
|
|
61
|
+
/* The plain button: a card with a control-strength stroke, which is its only boundary. */
|
|
62
|
+
.cbx-ui-btn--ghost { background: var(--card); color: var(--foreground); border-color: var(--control-border); }
|
|
63
|
+
.cbx-ui-btn--ghost:hover:not(:disabled):not([aria-disabled='true']) { border-color: var(--border-strong); background: var(--secondary); }
|
|
64
|
+
/* A step below primary: the accent wash, its text pulled towards the foreground so it reads
|
|
65
|
+
* at 4.5:1 on the wash in both themes. */
|
|
66
|
+
.cbx-ui-btn--secondary {
|
|
67
|
+
background: var(--accent-soft);
|
|
68
|
+
color: color-mix(in oklab, var(--accent) 72%, var(--foreground));
|
|
69
|
+
border-color: color-mix(in oklch, var(--accent) 80%, transparent);
|
|
70
|
+
}
|
|
71
|
+
.cbx-ui-btn--secondary:hover:not(:disabled):not([aria-disabled='true']) {
|
|
72
|
+
background: color-mix(in oklch, var(--accent) 18%, transparent);
|
|
73
|
+
border-color: var(--accent);
|
|
74
|
+
}
|
|
75
|
+
/* Resting in the readable tone text, not only on hover: a button cannot know what it sits on. */
|
|
76
|
+
.cbx-ui-btn--danger { color: var(--destructive-text); border-color: color-mix(in oklch, var(--destructive) 80%, transparent); }
|
|
77
|
+
.cbx-ui-btn--danger:hover:not(:disabled):not([aria-disabled='true']) { background: var(--destructive-soft); }
|
|
78
|
+
.cbx-ui-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
|
|
79
|
+
.cbx-ui-btn--lg { height: 42px; padding: 0 18px; font-size: 14px; }
|
|
80
|
+
|
|
81
|
+
/* ── Spinner */
|
|
82
|
+
.cbx-ui-spinner {
|
|
83
|
+
display: inline-block;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
width: 0.95rem;
|
|
87
|
+
height: 0.95rem;
|
|
88
|
+
border-radius: 9999px;
|
|
89
|
+
border: 2px solid color-mix(in oklch, currentColor 30%, transparent);
|
|
90
|
+
border-top-color: currentColor;
|
|
91
|
+
animation: cbx-ui-spin 0.6s linear infinite;
|
|
92
|
+
}
|
|
93
|
+
@keyframes cbx-ui-spin { to { transform: rotate(360deg); } }
|
|
94
|
+
/* Slower, never frozen: a still ring reads as a broken control. */
|
|
95
|
+
@media (prefers-reduced-motion: reduce) { .cbx-ui-spinner { animation-duration: 1.6s !important; } }
|
|
96
|
+
|
|
97
|
+
/* ── Field: label, control, hint, error */
|
|
98
|
+
.cbx-ui-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
|
|
99
|
+
.cbx-ui-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--foreground); }
|
|
100
|
+
.cbx-ui-field-head .cbx-ui-label { margin: 0; }
|
|
101
|
+
.cbx-ui-label-required { color: var(--destructive-text); }
|
|
102
|
+
.cbx-ui-label-optional { color: var(--muted-foreground); font-weight: 400; }
|
|
103
|
+
.cbx-ui-hint { margin: 5px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted-foreground); }
|
|
104
|
+
.cbx-ui-error { margin: 5px 0 0; font-size: 12px; line-height: 1.4; color: var(--destructive-text); }
|
|
105
|
+
.cbx-ui-error[hidden] { display: none; }
|
|
106
|
+
.cbx-ui-sr-only {
|
|
107
|
+
position: absolute;
|
|
108
|
+
width: 1px;
|
|
109
|
+
height: 1px;
|
|
110
|
+
padding: 0;
|
|
111
|
+
margin: -1px;
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
clip: rect(0, 0, 0, 0);
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
border: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ── Input and Textarea: 36px, 13px; 16px below 768px so iOS does not zoom into it. */
|
|
119
|
+
.cbx-ui-input {
|
|
120
|
+
display: block;
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 36px;
|
|
123
|
+
padding: 0 10px;
|
|
124
|
+
border: 1px solid var(--control-border);
|
|
125
|
+
border-radius: var(--radius-md, 8px);
|
|
126
|
+
background: var(--card);
|
|
127
|
+
color: var(--foreground);
|
|
128
|
+
font: inherit;
|
|
129
|
+
font-size: 13px;
|
|
130
|
+
transition: border-color 150ms var(--cbx-ui-ease), box-shadow 150ms var(--cbx-ui-ease);
|
|
131
|
+
}
|
|
132
|
+
.cbx-ui-input::placeholder { color: var(--muted-foreground); opacity: 1; }
|
|
133
|
+
.cbx-ui-input:hover:not(:focus):not(:disabled) { border-color: var(--border-strong); }
|
|
134
|
+
.cbx-ui-input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }
|
|
135
|
+
.cbx-ui-input:disabled { opacity: 0.6; cursor: not-allowed; }
|
|
136
|
+
.cbx-ui-input[aria-invalid='true'] { border-color: var(--destructive); }
|
|
137
|
+
.cbx-ui-input[aria-invalid='true']:focus { box-shadow: 0 0 0 1px var(--destructive); }
|
|
138
|
+
.cbx-ui-input--lg { height: 44px; padding: 0 14px; font-size: 14px; }
|
|
139
|
+
textarea.cbx-ui-input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
|
|
140
|
+
@media (max-width: 767px) { .cbx-ui-input, .cbx-ui-input--lg { font-size: 16px; } }
|
|
141
|
+
|
|
142
|
+
/* ── Checkbox and radio: a 16px native box drawn on the tokens, a 24px hit area. */
|
|
143
|
+
.cbx-ui-check,
|
|
144
|
+
.cbx-ui-radio { display: flex; align-items: flex-start; gap: 9px; }
|
|
145
|
+
.cbx-ui-radios { display: flex; flex-direction: column; gap: 10px; }
|
|
146
|
+
.cbx-ui-check-box,
|
|
147
|
+
.cbx-ui-radio-box { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }
|
|
148
|
+
.cbx-ui-check-input,
|
|
149
|
+
.cbx-ui-radio-input {
|
|
150
|
+
appearance: none;
|
|
151
|
+
-webkit-appearance: none;
|
|
152
|
+
position: absolute;
|
|
153
|
+
inset: 0;
|
|
154
|
+
width: 16px;
|
|
155
|
+
height: 16px;
|
|
156
|
+
margin: 0;
|
|
157
|
+
border: 1px solid var(--control-border);
|
|
158
|
+
background: var(--card);
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
transition: background-color 150ms var(--cbx-ui-ease), border-color 150ms var(--cbx-ui-ease);
|
|
161
|
+
}
|
|
162
|
+
.cbx-ui-check-input { border-radius: 4px; }
|
|
163
|
+
.cbx-ui-radio-input { border-radius: 9999px; }
|
|
164
|
+
/* The drawing is 16px; the target is 24px (WCAG 2.2 SC 2.5.8). */
|
|
165
|
+
.cbx-ui-check-box::before,
|
|
166
|
+
.cbx-ui-radio-box::before { content: ''; position: absolute; inset: -4px; }
|
|
167
|
+
.cbx-ui-check-input:hover:not(:disabled),
|
|
168
|
+
.cbx-ui-radio-input:hover:not(:disabled) { border-color: var(--border-strong); }
|
|
169
|
+
.cbx-ui-check-input:focus-visible,
|
|
170
|
+
.cbx-ui-radio-input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
171
|
+
.cbx-ui-check-input:checked,
|
|
172
|
+
.cbx-ui-check-input:indeterminate { background: var(--primary); border-color: var(--primary); }
|
|
173
|
+
.cbx-ui-radio-input:checked { border-color: var(--primary); }
|
|
174
|
+
.cbx-ui-check-input:disabled,
|
|
175
|
+
.cbx-ui-radio-input:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
176
|
+
.cbx-ui-check-mark { position: relative; display: none; width: 12px; height: 12px; color: var(--primary-foreground); pointer-events: none; }
|
|
177
|
+
.cbx-ui-check-input:checked ~ .cbx-ui-check-mark--check,
|
|
178
|
+
.cbx-ui-check-input:indeterminate ~ .cbx-ui-check-mark--minus { display: block; }
|
|
179
|
+
.cbx-ui-check-input:indeterminate ~ .cbx-ui-check-mark--check { display: none; }
|
|
180
|
+
.cbx-ui-radio-dot { position: relative; display: none; width: 8px; height: 8px; border-radius: 9999px; background: var(--primary); pointer-events: none; }
|
|
181
|
+
.cbx-ui-radio-input:checked ~ .cbx-ui-radio-dot { display: block; }
|
|
182
|
+
.cbx-ui-check-text,
|
|
183
|
+
.cbx-ui-radio-text { min-width: 0; }
|
|
184
|
+
.cbx-ui-check-label,
|
|
185
|
+
.cbx-ui-radio-label { display: block; font-size: 13px; line-height: 1.4; color: var(--foreground); cursor: pointer; }
|
|
186
|
+
.cbx-ui-check-hint,
|
|
187
|
+
.cbx-ui-radio-hint { display: block; margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted-foreground); }
|
|
188
|
+
.cbx-ui-radio.is-disabled .cbx-ui-radio-label,
|
|
189
|
+
.cbx-ui-check.is-disabled .cbx-ui-check-label { cursor: not-allowed; opacity: 0.6; }
|
|
190
|
+
|
|
191
|
+
/* ── Switch: 36×20, a 16px thumb. */
|
|
192
|
+
.cbx-ui-switch {
|
|
193
|
+
position: relative;
|
|
194
|
+
display: inline-block;
|
|
195
|
+
flex-shrink: 0;
|
|
196
|
+
width: 36px;
|
|
197
|
+
height: 20px;
|
|
198
|
+
margin: 0;
|
|
199
|
+
padding: 0;
|
|
200
|
+
border: 1px solid var(--control-border);
|
|
201
|
+
border-radius: 9999px;
|
|
202
|
+
background: var(--input);
|
|
203
|
+
cursor: pointer;
|
|
204
|
+
transition: background-color 150ms var(--cbx-ui-ease), border-color 150ms var(--cbx-ui-ease);
|
|
205
|
+
}
|
|
206
|
+
.cbx-ui-switch::before { content: ''; position: absolute; inset: -3px -1px; }
|
|
207
|
+
.cbx-ui-switch:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
208
|
+
.cbx-ui-switch[aria-checked='true'] { background: var(--primary); border-color: var(--primary); }
|
|
209
|
+
.cbx-ui-switch:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
210
|
+
.cbx-ui-switch-thumb {
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: 1px;
|
|
213
|
+
left: 1px;
|
|
214
|
+
width: 16px;
|
|
215
|
+
height: 16px;
|
|
216
|
+
border-radius: 9999px;
|
|
217
|
+
background: var(--card);
|
|
218
|
+
box-shadow: 0 1px 2px oklch(0.2 0.02 75 / 0.25);
|
|
219
|
+
transition: transform 150ms var(--cbx-ui-ease);
|
|
220
|
+
}
|
|
221
|
+
.cbx-ui-switch[aria-checked='true'] .cbx-ui-switch-thumb { transform: translateX(16px); }
|
|
222
|
+
|
|
223
|
+
/* ── Icon button (the dialog's close): 28px, 40px under a coarse pointer. */
|
|
224
|
+
.cbx-ui-iconbtn {
|
|
225
|
+
display: inline-flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
flex-shrink: 0;
|
|
229
|
+
width: 28px;
|
|
230
|
+
height: 28px;
|
|
231
|
+
margin: 0;
|
|
232
|
+
padding: 0;
|
|
233
|
+
border: 1px solid transparent;
|
|
234
|
+
border-radius: var(--radius-sm, 6px);
|
|
235
|
+
background: transparent;
|
|
236
|
+
color: var(--muted-foreground);
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
transition: background-color 150ms var(--cbx-ui-ease), color 150ms var(--cbx-ui-ease);
|
|
239
|
+
}
|
|
240
|
+
.cbx-ui-iconbtn:hover { background: var(--secondary); color: var(--foreground); }
|
|
241
|
+
.cbx-ui-iconbtn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
242
|
+
.cbx-ui-iconbtn > svg { width: 16px; height: 16px; }
|
|
243
|
+
@media (pointer: coarse) { .cbx-ui-iconbtn { width: 40px; height: 40px; } }
|
|
244
|
+
|
|
245
|
+
/* ── Dialog */
|
|
246
|
+
.cbx-ui-overlay {
|
|
247
|
+
position: fixed;
|
|
248
|
+
inset: 0;
|
|
249
|
+
z-index: 90;
|
|
250
|
+
background: var(--overlay, oklch(0.2 0.015 75 / 0.45));
|
|
251
|
+
animation: cbx-ui-fade 200ms var(--cbx-ui-ease, ease);
|
|
252
|
+
}
|
|
253
|
+
.cbx-ui-dialog {
|
|
254
|
+
position: fixed;
|
|
255
|
+
z-index: 91;
|
|
256
|
+
left: 50%;
|
|
257
|
+
top: 50%;
|
|
258
|
+
transform: translate(-50%, -50%);
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
width: calc(100vw - 32px);
|
|
262
|
+
max-height: calc(100dvh - 64px);
|
|
263
|
+
background: var(--popover);
|
|
264
|
+
color: var(--popover-foreground);
|
|
265
|
+
border: 1px solid var(--border);
|
|
266
|
+
border-radius: var(--radius, 12px);
|
|
267
|
+
box-shadow: 0 1px 2px oklch(0.2 0.02 75 / 0.08), 0 16px 48px oklch(0.2 0.02 75 / 0.24);
|
|
268
|
+
/* Portalled to <body>, outside the shell: it states its own type. */
|
|
269
|
+
font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', sans-serif);
|
|
270
|
+
font-size: 14px;
|
|
271
|
+
line-height: 1.45;
|
|
272
|
+
animation: cbx-ui-pop 200ms var(--cbx-ui-ease);
|
|
273
|
+
}
|
|
274
|
+
.cbx-ui-dialog:focus { outline: none; }
|
|
275
|
+
.cbx-ui-dialog--sm { max-width: 24rem; }
|
|
276
|
+
.cbx-ui-dialog--md { max-width: 32rem; }
|
|
277
|
+
.cbx-ui-dialog--lg { max-width: 48rem; }
|
|
278
|
+
.cbx-ui-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
|
|
279
|
+
.cbx-ui-dialog-heading { min-width: 0; }
|
|
280
|
+
.cbx-ui-dialog-title { margin: 0; font-family: var(--font-display, system-ui, sans-serif); font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--foreground); }
|
|
281
|
+
.cbx-ui-dialog-desc { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted-foreground); }
|
|
282
|
+
/* The body is the only part that scrolls, so the footer's actions stay in reach. */
|
|
283
|
+
.cbx-ui-dialog-body { flex: 1; min-height: 0; padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
|
|
284
|
+
.cbx-ui-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
|
|
285
|
+
.cbx-ui-dialog-head + .cbx-ui-dialog-foot { padding-top: 16px; }
|
|
286
|
+
@keyframes cbx-ui-fade { from { opacity: 0; } }
|
|
287
|
+
@keyframes cbx-ui-pop { from { opacity: 0; transform: translate(-50%, calc(-50% + 4px)) scale(0.98); } }
|
|
288
|
+
@media (prefers-reduced-motion: reduce) { .cbx-ui-overlay, .cbx-ui-dialog { animation: none; } }
|
|
289
|
+
}
|
package/tokens/shell.css
CHANGED
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
--cbx-tile-fg-l: 0.93;
|
|
37
37
|
--cbx-tone-neutral: oklch(0.6 0.01 80);
|
|
38
38
|
}
|
|
39
|
-
/* Resets carry no specificity (:where), so every component rule below wins over them.
|
|
39
|
+
/* Resets carry no specificity (:where), so every component rule below wins over them. They skip the
|
|
40
|
+
* form controls (`cbx-ui-*`, controls.css), which live in `@layer components` and would otherwise
|
|
41
|
+
* lose to any unlayered rule. */
|
|
40
42
|
:where(.cbx-shell, .cbx-overlay, .cbx-popover) *, :where(.cbx-shell, .cbx-overlay, .cbx-popover) *::before, :where(.cbx-shell, .cbx-overlay, .cbx-popover) *::after { box-sizing: border-box; }
|
|
41
|
-
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(button, input, textarea) { font: inherit; color: inherit; }
|
|
42
|
-
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(button) { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
|
|
43
|
-
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(a) { color: inherit; text-decoration: none; }
|
|
44
|
-
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(h1, h2, h3, p) { margin: 0; }
|
|
43
|
+
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(button, input, textarea):where(:not([class*='cbx-ui-'])) { font: inherit; color: inherit; }
|
|
44
|
+
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(button):where(:not([class*='cbx-ui-'])) { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
|
|
45
|
+
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(a):where(:not([class*='cbx-ui-'])) { color: inherit; text-decoration: none; }
|
|
46
|
+
:where(.cbx-shell, .cbx-overlay, .cbx-popover) :where(h1, h2, h3, p):where(:not([class*='cbx-ui-'])) { margin: 0; }
|
|
45
47
|
:is(.cbx-shell, .cbx-overlay, .cbx-popover) :is(a, button, input, textarea, [tabindex]):focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
46
48
|
:is(.cbx-shell, .cbx-overlay, .cbx-popover) :is(input, textarea):focus-visible { outline-offset: 0; }
|
|
47
49
|
.cbx-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|