@cboxdk/cbox-ui 0.16.0 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cboxdk/cbox-ui",
3
- "version": "0.16.0",
3
+ "version": "0.17.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": {
@@ -140,6 +140,136 @@
140
140
  textarea.cbx-ui-input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
141
141
  @media (max-width: 767px) { .cbx-ui-input, .cbx-ui-input--lg { font-size: 16px; } }
142
142
 
143
+ /* ── Combobox: a 36px trigger that never changes size, and a panel portalled to <body> (or the
144
+ sheet it is in), placed `fixed` against the trigger by floating.ts. At least 16rem wide, up
145
+ to 22rem for long labels; it flips above the trigger near the bottom of the screen. */
146
+ .cbx-ui-combo { position: relative; display: inline-block; max-width: 100%; vertical-align: middle; }
147
+ .cbx-ui-combo--full { display: block; width: 100%; }
148
+ .cbx-ui-combo-trigger {
149
+ box-sizing: border-box;
150
+ display: flex;
151
+ align-items: center;
152
+ gap: 8px;
153
+ height: 36px;
154
+ max-width: 100%;
155
+ padding: 0 10px 0 12px;
156
+ border: 1px solid var(--control-border);
157
+ border-radius: var(--radius-md, 8px);
158
+ background: var(--card);
159
+ color: var(--foreground);
160
+ font: inherit;
161
+ font-size: 13px;
162
+ line-height: 1;
163
+ text-align: left;
164
+ cursor: pointer;
165
+ transition: border-color 150ms ease, box-shadow 150ms ease;
166
+ }
167
+ .cbx-ui-combo--full .cbx-ui-combo-trigger { width: 100%; }
168
+ .cbx-ui-combo-trigger:hover:not(:disabled) { border-color: var(--border-strong); }
169
+ .cbx-ui-combo-trigger:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }
170
+ /* Open: a ring drawn with box-shadow, so the trigger's box stays exactly where it was. */
171
+ .cbx-ui-combo-trigger[aria-expanded='true'] { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }
172
+ .cbx-ui-combo-trigger[aria-invalid='true'] { border-color: var(--destructive); }
173
+ .cbx-ui-combo-trigger:disabled { opacity: 0.6; cursor: not-allowed; }
174
+ .cbx-ui-combo-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
175
+ .cbx-ui-combo-value.is-placeholder { color: var(--muted-foreground); }
176
+ .cbx-ui-combo-chevron { flex: none; color: var(--muted-foreground); transition: transform 150ms ease; }
177
+ .cbx-ui-combo-trigger[aria-expanded='true'] .cbx-ui-combo-chevron { transform: rotate(180deg); }
178
+ .cbx-ui-combo-icon { flex: none; width: 14px; height: 14px; color: var(--muted-foreground); }
179
+ .cbx-ui-combo-avatar {
180
+ display: inline-flex; flex: none; align-items: center; justify-content: center;
181
+ width: 20px; height: 20px; border-radius: 6px; object-fit: cover;
182
+ background: var(--secondary); font-size: 9px; font-weight: 600; letter-spacing: -0.01em;
183
+ }
184
+ .cbx-ui-combo-avatar.is-initials { background: var(--info-soft); color: var(--info-text); }
185
+
186
+ .cbx-ui-combo-panel {
187
+ position: fixed;
188
+ /* Above a sheet (91) when it is inside one; a page's combobox closes before a sheet opens. */
189
+ z-index: 95;
190
+ box-sizing: border-box;
191
+ display: flex;
192
+ flex-direction: column;
193
+ overflow: hidden;
194
+ background: var(--popover);
195
+ color: var(--popover-foreground);
196
+ border: 1px solid var(--border);
197
+ border-radius: 10px;
198
+ box-shadow: 0 1px 2px oklch(0.2 0.02 75 / 0.08), 0 12px 32px oklch(0.2 0.02 75 / 0.18);
199
+ font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', sans-serif);
200
+ font-size: 13px;
201
+ line-height: 1.4;
202
+ animation: cbx-ui-fade 120ms ease;
203
+ }
204
+ .cbx-ui-combo-search-row { position: relative; flex: none; padding: 8px; border-bottom: 1px solid var(--border); }
205
+ .cbx-ui-combo-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
206
+ .cbx-ui-combo-search {
207
+ box-sizing: border-box; display: block; width: 100%; min-width: 0; height: 32px;
208
+ padding: 0 8px 0 28px; border: 0; border-radius: 6px; background: transparent;
209
+ color: var(--foreground); font: inherit; font-size: 13px; outline: none;
210
+ }
211
+ .cbx-ui-combo-search::placeholder { color: var(--muted-foreground); opacity: 1; }
212
+ .cbx-ui-combo-list { flex: 1 1 auto; min-height: 0; max-height: 18rem; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
213
+ .cbx-ui-combo-list[hidden] { display: none; }
214
+ .cbx-ui-combo-grouplist { margin: 0; padding: 0; list-style: none; }
215
+ .cbx-ui-combo-group { padding: 8px 8px 4px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-foreground); }
216
+ .cbx-ui-combo-option {
217
+ box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%;
218
+ min-height: 36px; margin: 0 0 2px; padding: 6px 8px; border: 0; border-radius: 6px;
219
+ background: transparent; color: var(--foreground); font: inherit; text-align: left; cursor: pointer;
220
+ }
221
+ .cbx-ui-combo-linkrow { padding: 0; }
222
+ .cbx-ui-combo-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px; color: inherit; text-decoration: none; }
223
+ .cbx-ui-combo-option[data-highlighted] { background: var(--secondary); }
224
+ .cbx-ui-combo-option[data-active] { background: var(--accent-soft); }
225
+ .cbx-ui-combo-option[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
226
+ .cbx-ui-combo-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 1px; }
227
+ .cbx-ui-combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
228
+ .cbx-ui-combo-secondary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; color: var(--muted-foreground); }
229
+ .cbx-ui-combo-check { flex: none; color: var(--accent); }
230
+ .cbx-ui-combo-create { color: var(--info-text); }
231
+ .cbx-ui-combo-create .cbx-ui-combo-icon { color: currentColor; }
232
+ .cbx-ui-combo-empty { margin: 0; padding: 16px 12px; text-align: center; color: var(--muted-foreground); }
233
+ .cbx-ui-combo-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; color: var(--destructive-text); border-bottom: 1px solid var(--border); }
234
+ .cbx-ui-combo-note:last-child { border-bottom: 0; }
235
+ .cbx-ui-combo-note .cbx-ui-combo-icon { margin-top: 1px; color: currentColor; }
236
+ .cbx-ui-combo-footer { display: flex; flex: none; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); color: var(--info-text); font-weight: 500; text-decoration: none; }
237
+ .cbx-ui-combo-footer:hover { background: var(--info-soft); }
238
+
239
+ /* ── TagInput: chips and the input in one field box. 36px tall while it holds one row; chips
240
+ are 24px, so the box never changes height while typing, opening or validating. */
241
+ .cbx-ui-tags {
242
+ box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
243
+ width: 100%; min-height: 36px; padding: 5px 8px 5px 5px;
244
+ border: 1px solid var(--control-border); border-radius: var(--radius-md, 8px);
245
+ background: var(--card); color: var(--foreground); font-size: 13px; cursor: text;
246
+ transition: border-color 150ms ease, box-shadow 150ms ease;
247
+ }
248
+ .cbx-ui-tags:hover:not(:focus-within):not([data-disabled]) { border-color: var(--border-strong); }
249
+ .cbx-ui-tags:focus-within { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }
250
+ .cbx-ui-tags[data-invalid] { border-color: var(--destructive); }
251
+ .cbx-ui-tags[data-invalid]:focus-within { box-shadow: 0 0 0 1px var(--destructive); }
252
+ .cbx-ui-tags[data-disabled] { opacity: 0.6; cursor: not-allowed; }
253
+ .cbx-ui-tag {
254
+ box-sizing: border-box; display: inline-flex; align-items: center; gap: 2px;
255
+ height: 24px; max-width: 100%; padding: 0 2px 0 8px; border-radius: 6px;
256
+ background: var(--secondary); border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; line-height: 1;
257
+ }
258
+ .cbx-ui-tag-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
259
+ .cbx-ui-tag-remove {
260
+ display: inline-flex; flex: none; align-items: center; justify-content: center;
261
+ width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px;
262
+ background: transparent; color: var(--muted-foreground); cursor: pointer;
263
+ }
264
+ .cbx-ui-tag-remove:hover { background: var(--border); color: var(--foreground); }
265
+ .cbx-ui-tag-remove > svg { width: 12px; height: 12px; }
266
+ .cbx-ui-tags-input {
267
+ flex: 1 0 6rem; min-width: 6rem; height: 24px; padding: 0 0 0 3px; border: 0;
268
+ background: transparent; color: var(--foreground); font: inherit; font-size: 13px; outline: none;
269
+ }
270
+ .cbx-ui-tags-input::placeholder { color: var(--muted-foreground); opacity: 1; }
271
+ @media (max-width: 767px) { .cbx-ui-combo-search, .cbx-ui-tags-input { font-size: 16px; } }
272
+
143
273
  /* ── Checkbox and radio: a 16px native box drawn on the tokens, a 24px hit area. */
144
274
  .cbx-ui-check,
145
275
  .cbx-ui-radio { display: flex; align-items: flex-start; gap: 9px; }
package/tokens/shell.css CHANGED
@@ -591,8 +591,10 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
591
591
  .cbx-create-tree .cbx-field-search { margin-top: 0; }
592
592
  .cbx-create-env { display: flex; align-items: center; gap: 6px; margin: 0 2px 12px; font-size: 12.5px; color: var(--muted-foreground); }
593
593
  .cbx-create-form:not([hidden]) { display: flex; flex-direction: column; flex: 1; }
594
- .cbx-cform { display: flex; flex-direction: column; flex: 1; }
595
- .cbx-cfield { margin: 0 0 14px; }
594
+ /* The form spaces its children, so a Field, a RadioGroup or an app's own block sits as far from the
595
+ next one as a CreateField does; a hint never touches the next label. */
596
+ .cbx-cform { display: flex; flex-direction: column; flex: 1; gap: 14px; }
597
+ .cbx-cfield { margin: 0; }
596
598
  .cbx-cfield-label { display: block; margin: 0 2px 6px; font-size: 13px; font-weight: 600; }
597
599
  .cbx-cfield .cbx-group { margin: 0; }
598
600
  .cbx-cinput { width: 100%; height: 46px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: var(--secondary); color: var(--foreground); font-size: 16px; outline: none; }