basecoat-css 1.0.0-beta.3 → 1.0.0-beta.5

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.
Files changed (53) hide show
  1. package/dist/base/base.css +46 -44
  2. package/dist/basecoat-base.cdn.css +249 -65
  3. package/dist/basecoat-base.cdn.min.css +1 -1
  4. package/dist/basecoat-compat.cdn.css +22 -0
  5. package/dist/basecoat-compat.cdn.min.css +1 -1
  6. package/dist/basecoat-components.css +2 -0
  7. package/dist/basecoat-luma.cdn.css +430 -80
  8. package/dist/basecoat-luma.cdn.min.css +1 -1
  9. package/dist/basecoat-lyra.cdn.css +431 -78
  10. package/dist/basecoat-lyra.cdn.min.css +1 -1
  11. package/dist/basecoat-maia.cdn.css +421 -80
  12. package/dist/basecoat-maia.cdn.min.css +1 -1
  13. package/dist/basecoat-mira.cdn.css +418 -80
  14. package/dist/basecoat-mira.cdn.min.css +1 -1
  15. package/dist/basecoat-nova.cdn.css +435 -80
  16. package/dist/basecoat-nova.cdn.min.css +1 -1
  17. package/dist/basecoat-rhea.cdn.css +440 -91
  18. package/dist/basecoat-rhea.cdn.min.css +1 -1
  19. package/dist/basecoat-sera.cdn.css +424 -78
  20. package/dist/basecoat-sera.cdn.min.css +1 -1
  21. package/dist/basecoat-vega.cdn.css +424 -79
  22. package/dist/basecoat-vega.cdn.min.css +1 -1
  23. package/dist/basecoat.cdn.css +424 -79
  24. package/dist/basecoat.cdn.min.css +1 -1
  25. package/dist/compat/legacy.css +6 -0
  26. package/dist/components/accordion.css +27 -0
  27. package/dist/components/alert.css +12 -0
  28. package/dist/components/avatar.css +6 -6
  29. package/dist/components/breadcrumb.css +30 -0
  30. package/dist/components/card.css +4 -0
  31. package/dist/components/combobox.css +23 -2
  32. package/dist/components/command.css +19 -12
  33. package/dist/components/dialog.css +30 -1
  34. package/dist/components/dropdown-menu.css +1 -1
  35. package/dist/js/accordion.js +68 -0
  36. package/dist/js/accordion.min.js +1 -0
  37. package/dist/js/all.js +199 -28
  38. package/dist/js/all.min.js +1 -1
  39. package/dist/js/combobox.js +115 -26
  40. package/dist/js/combobox.min.js +1 -1
  41. package/dist/js/command.js +3 -1
  42. package/dist/js/command.min.js +1 -1
  43. package/dist/js/dropdown-menu.js +12 -1
  44. package/dist/js/dropdown-menu.min.js +1 -1
  45. package/dist/styles/luma.css +85 -11
  46. package/dist/styles/lyra.css +81 -11
  47. package/dist/styles/maia.css +85 -11
  48. package/dist/styles/mira.css +85 -11
  49. package/dist/styles/nova.css +83 -13
  50. package/dist/styles/rhea.css +89 -15
  51. package/dist/styles/sera.css +80 -10
  52. package/dist/styles/vega.css +82 -12
  53. package/package.json +1 -1
@@ -2,12 +2,29 @@
2
2
  const states = new WeakMap();
3
3
 
4
4
  const getElements = (root) => {
5
- const input = root.querySelector(':scope > input[role="combobox"], :scope > .combobox-chips input[role="combobox"]');
6
- const chips = root.querySelector(':scope > .combobox-chips');
7
5
  const popover = root.querySelector(':scope > [data-popover]');
6
+ const input = root.querySelector(':scope > input[role="combobox"], :scope > .input-group input[role="combobox"], :scope > .combobox-chips input[role="combobox"]')
7
+ || popover?.querySelector('input[role="combobox"]');
8
+ const chips = root.querySelector(':scope > .combobox-chips');
9
+ const popupTrigger = root.querySelector(':scope > button[aria-haspopup="listbox"]');
10
+ const trigger = popupTrigger || root.querySelector(':scope > .input-group button[aria-haspopup="listbox"]');
11
+ const clearButton = root.querySelector('[data-clear]');
12
+ const valueTarget = popupTrigger?.querySelector('[data-value]') || (popupTrigger?.matches('[data-value]') ? popupTrigger : null);
8
13
  const listbox = popover ? popover.querySelector('[role="listbox"]') : null;
9
14
  const hiddenInput = root.querySelector(':scope > input[type="hidden"]');
10
- return { input, chips, popover, listbox, hiddenInput };
15
+ return { input, chips, trigger, clearButton, valueTarget, popover, listbox, hiddenInput };
16
+ };
17
+
18
+ const ensureMultipleInputSurface = (root, elements) => {
19
+ if (elements.listbox?.getAttribute('aria-multiselectable') !== 'true' || elements.chips || !elements.input) return elements;
20
+ if (elements.input.parentElement !== root) return elements;
21
+
22
+ const chips = document.createElement('div');
23
+ chips.className = 'combobox-chips';
24
+ root.insertBefore(chips, elements.input);
25
+ chips.appendChild(elements.input);
26
+
27
+ return getElements(root);
11
28
  };
12
29
 
13
30
  const getValue = option => option.dataset.value ?? option.textContent.trim();
@@ -111,7 +128,7 @@
111
128
  state.popover.dataset.empty = String(state.visibleOptions.length === 0);
112
129
  };
113
130
 
114
- const filterOptions = (state, { preserveActive = false } = {}) => {
131
+ const filterOptions = (state, { preserveActive = false, search: forcedSearch } = {}) => {
115
132
  const previousActive = state.activeIndex > -1 ? state.options[state.activeIndex] : null;
116
133
  state.visibleOptions = [];
117
134
 
@@ -127,7 +144,7 @@
127
144
  return;
128
145
  }
129
146
 
130
- const search = state.input.value.trim().toLowerCase();
147
+ const search = (forcedSearch ?? state.input.value).trim().toLowerCase();
131
148
 
132
149
  state.allOptions.forEach(option => {
133
150
  if (option.hasAttribute('data-force')) {
@@ -161,20 +178,42 @@
161
178
  const chip = document.createElement('span');
162
179
  chip.className = 'combobox-chip';
163
180
  chip.dataset.value = entry.value;
164
- chip.textContent = entry.label;
181
+
182
+ const label = document.createElement('span');
183
+ label.textContent = entry.label;
165
184
 
166
185
  const remove = document.createElement('button');
167
186
  remove.type = 'button';
168
- remove.className = 'combobox-chip-remove';
187
+ remove.className = 'combobox-chip-remove btn';
188
+ remove.dataset.variant = 'ghost';
189
+ remove.dataset.size = 'icon-xs';
169
190
  remove.setAttribute('aria-label', `Remove ${entry.label}`);
170
191
  remove.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>';
171
- remove.addEventListener('click', () => root.deselect(entry.value));
192
+ remove.addEventListener('click', (event) => {
193
+ event.stopPropagation();
194
+ root.deselect(entry.value);
195
+ state.input.focus();
196
+ });
172
197
 
198
+ chip.appendChild(label);
173
199
  chip.appendChild(remove);
174
200
  state.chips.insertBefore(chip, state.input);
175
201
  });
176
202
  };
177
203
 
204
+ const syncTriggerValue = (state) => {
205
+ if (!state.valueTarget) return;
206
+ const selected = getSelection(state);
207
+ state.valueTarget.textContent = state.isMultiple
208
+ ? selected.map(entry => entry.label).join(', ')
209
+ : (selected[0]?.label || state.valueTarget.dataset.placeholder || '');
210
+ };
211
+
212
+ const syncClearButton = (state) => {
213
+ if (!state.clearButton) return;
214
+ state.clearButton.hidden = getSelection(state).length === 0 && state.input.value === '';
215
+ };
216
+
178
217
  const syncSelectedOptions = (state) => {
179
218
  state.options.forEach(option => {
180
219
  if (state.selected.has(getValue(option))) {
@@ -195,7 +234,7 @@
195
234
  state.input.value = '';
196
235
  } else if (normalized[0]) {
197
236
  state.selected.set(normalized[0].value, normalized[0]);
198
- state.input.value = normalized[0].label;
237
+ state.input.value = state.valueTarget ? '' : normalized[0].label;
199
238
  } else {
200
239
  state.input.value = '';
201
240
  }
@@ -206,6 +245,8 @@
206
245
  renderChips(root);
207
246
  filterOptions(state, { preserveActive: true });
208
247
  }
248
+ syncTriggerValue(state);
249
+ syncClearButton(state);
209
250
 
210
251
  if (triggerEvent) {
211
252
  root.dispatchEvent(new CustomEvent('change', {
@@ -219,15 +260,35 @@
219
260
  if (state.popover.getAttribute('aria-hidden') === 'true') return;
220
261
  state.popover.setAttribute('aria-hidden', 'true');
221
262
  state.input.setAttribute('aria-expanded', 'false');
263
+ state.trigger?.setAttribute('aria-expanded', 'false');
222
264
  setActiveOption(state, -1);
223
- if (focusInput) state.input.focus();
265
+ if (focusInput) {
266
+ state.skipOpenOnFocus = true;
267
+ state.input.focus();
268
+ requestAnimationFrame(() => { state.skipOpenOnFocus = false; });
269
+ }
270
+ };
271
+
272
+ const openPopover = (state) => {
273
+ const { root } = state;
274
+ if (state.popover.getAttribute('aria-hidden') === 'false') return;
275
+ document.dispatchEvent(new CustomEvent('basecoat:popover', { detail: { source: root } }));
276
+ root.refresh();
277
+ const selected = getSelection(state)[0];
278
+ if (state.valueTarget) state.input.value = '';
279
+ const search = !state.isMultiple && selected && state.input.value === selected.label ? '' : undefined;
280
+ filterOptions(state, { search });
281
+ state.popover.setAttribute('aria-hidden', 'false');
282
+ state.input.setAttribute('aria-expanded', 'true');
283
+ state.trigger?.setAttribute('aria-expanded', 'true');
284
+ if (state.trigger) state.input.focus();
224
285
  };
225
286
 
226
287
  const refreshCombobox = (root) => {
227
288
  const state = states.get(root);
228
289
  if (!state) return;
229
290
 
230
- const elements = getElements(root);
291
+ let elements = getElements(root);
231
292
  if (!elements.input || !elements.popover || !elements.listbox || !elements.hiddenInput) {
232
293
  const missing = [];
233
294
  if (!elements.input) missing.push('input');
@@ -238,6 +299,7 @@
238
299
  return;
239
300
  }
240
301
 
302
+ elements = ensureMultipleInputSurface(root, elements);
241
303
  const previousValue = elements.hiddenInput.value;
242
304
  const previousInputValue = elements.input.value;
243
305
  Object.assign(state, elements, getOptions(elements.listbox));
@@ -264,6 +326,8 @@
264
326
  filterOptions(state, { preserveActive: true });
265
327
  }
266
328
  }
329
+ syncTriggerValue(state);
330
+ syncClearButton(state);
267
331
  };
268
332
 
269
333
  const resolveEntry = (state, value) => {
@@ -290,7 +354,8 @@
290
354
  if (state.closeOnSelect) root.close(true);
291
355
  } else {
292
356
  setSelected(root, entry);
293
- root.close(true);
357
+ root.close(state.trigger ? false : true);
358
+ state.trigger?.focus();
294
359
  }
295
360
  };
296
361
 
@@ -302,6 +367,15 @@
302
367
  setSelected(root, getSelection(state).filter(item => item.value !== normalized));
303
368
  };
304
369
 
370
+ const clearValue = (root) => {
371
+ const state = states.get(root);
372
+ setSelected(root, [], true);
373
+ state.input.value = '';
374
+ filterOptions(state);
375
+ syncClearButton(state);
376
+ if (state.popover.getAttribute('aria-hidden') === 'false') state.input.focus();
377
+ };
378
+
305
379
  const handleKeydown = (event, root) => {
306
380
  const state = states.get(root);
307
381
  if (!['ArrowDown', 'ArrowUp', 'Enter', 'Home', 'End', 'Escape', 'Backspace'].includes(event.key)) return;
@@ -322,7 +396,7 @@
322
396
 
323
397
  if (!isOpen && ['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {
324
398
  event.preventDefault();
325
- root.open();
399
+ openPopover(state);
326
400
  }
327
401
 
328
402
  if (state.popover.getAttribute('aria-hidden') === 'true') return;
@@ -355,7 +429,7 @@
355
429
  const initCombobox = (root) => {
356
430
  if (root.dataset.comboboxInitialized) return;
357
431
 
358
- const state = { root, activeIndex: -1, allOptions: [], options: [], visibleOptions: [], selected: new Map(), format: 'value', manualFilter: false };
432
+ const state = { root, activeIndex: -1, allOptions: [], options: [], visibleOptions: [], selected: new Map(), format: 'value', manualFilter: false, skipOpenOnFocus: false };
359
433
  states.set(root, state);
360
434
  root.refresh = () => refreshCombobox(root);
361
435
 
@@ -366,14 +440,6 @@
366
440
  return;
367
441
  }
368
442
 
369
- root.open = () => {
370
- if (state.popover.getAttribute('aria-hidden') === 'false') return;
371
- document.dispatchEvent(new CustomEvent('basecoat:popover', { detail: { source: root } }));
372
- root.refresh();
373
- filterOptions(state);
374
- state.popover.setAttribute('aria-hidden', 'false');
375
- state.input.setAttribute('aria-expanded', 'true');
376
- };
377
443
  root.close = (focusInput = false) => closePopover(state, focusInput);
378
444
 
379
445
  root.select = (value) => selectValue(root, value);
@@ -394,17 +460,34 @@
394
460
  root.selectNone = () => setSelected(root, []);
395
461
  }
396
462
 
397
- const handleInputFocus = root.open;
398
- const handleInputClick = root.open;
463
+ const handleInputFocus = () => {
464
+ if (state.skipOpenOnFocus) return;
465
+ openPopover(state);
466
+ };
467
+ const handleInputClick = () => openPopover(state);
399
468
  const handleInput = () => {
400
- root.open();
469
+ openPopover(state);
401
470
  filterOptions(state);
402
471
  if (!state.isMultiple) {
403
472
  state.hiddenInput.value = '';
404
473
  state.selected.clear();
405
474
  syncSelectedOptions(state);
475
+ syncTriggerValue(state);
476
+ syncClearButton(state);
477
+ }
478
+ };
479
+ const handleTriggerClick = () => {
480
+ if (state.popover.getAttribute('aria-hidden') === 'false') {
481
+ root.close(false);
482
+ } else {
483
+ openPopover(state);
406
484
  }
407
485
  };
486
+ const handleClearClick = (event) => {
487
+ event.preventDefault();
488
+ event.stopPropagation();
489
+ clearValue(root);
490
+ };
408
491
  const handleInputKeydown = (event) => handleKeydown(event, root);
409
492
  const handleListboxMousemove = (event) => {
410
493
  const option = event.target.closest('[role="option"]');
@@ -427,6 +510,8 @@
427
510
  state.input.addEventListener('click', handleInputClick);
428
511
  state.input.addEventListener('input', handleInput);
429
512
  state.input.addEventListener('keydown', handleInputKeydown);
513
+ state.trigger?.addEventListener('click', handleTriggerClick);
514
+ state.clearButton?.addEventListener('click', handleClearClick);
430
515
  state.listbox.addEventListener('mousemove', handleListboxMousemove);
431
516
  state.listbox.addEventListener('click', handleListboxClick);
432
517
  document.addEventListener('click', handleDocumentClick);
@@ -437,6 +522,8 @@
437
522
  state.input.removeEventListener('click', handleInputClick);
438
523
  state.input.removeEventListener('input', handleInput);
439
524
  state.input.removeEventListener('keydown', handleInputKeydown);
525
+ state.trigger?.removeEventListener('click', handleTriggerClick);
526
+ state.clearButton?.removeEventListener('click', handleClearClick);
440
527
  state.listbox.removeEventListener('mousemove', handleListboxMousemove);
441
528
  state.listbox.removeEventListener('click', handleListboxClick);
442
529
  document.removeEventListener('click', handleDocumentClick);
@@ -444,11 +531,11 @@
444
531
  state.chips?.querySelectorAll('.combobox-chip').forEach(chip => chip.remove());
445
532
  states.delete(root);
446
533
  delete root.refresh;
447
- delete root.open;
448
534
  delete root.close;
449
535
  delete root.select;
450
536
  delete root.selectByValue;
451
537
  delete root.setValue;
538
+ delete root.clear;
452
539
  delete root.deselect;
453
540
  delete root.toggle;
454
541
  delete root.selectAll;
@@ -457,6 +544,8 @@
457
544
 
458
545
  state.popover.setAttribute('aria-hidden', 'true');
459
546
  state.input.setAttribute('aria-expanded', 'false');
547
+ state.trigger?.setAttribute('aria-expanded', 'false');
548
+ root.clear = () => clearValue(root);
460
549
 
461
550
  Object.defineProperty(root, 'value', {
462
551
  configurable: true,
@@ -1 +1 @@
1
- (()=>{const e=new WeakMap,t=e=>e.dataset.value??e.textContent.trim(),i=e=>e.dataset.label||e.textContent.trim(),o=e=>({value:t(e),label:i(e)}),n=e=>{if(e&&"object"==typeof e){const t=null==e.value?"":String(e.value);return t?{value:t,label:String(e.label??e.value)}:null}const t=null==e?"":String(e);return t?{value:t,label:t}:null},l=e=>Array.from(e.selected.values()),s=e=>e.isMultiple?l(e).map((e=>e.value)):l(e)[0]?.value||"",r=e=>e.isMultiple?l(e):l(e)[0]||null,a=(e,t)=>{if(e.activeIndex>-1&&e.options[e.activeIndex]&&e.options[e.activeIndex].classList.remove("active"),e.activeIndex=t,e.activeIndex>-1){const t=e.options[e.activeIndex];t.classList.add("active"),t.id||(t.id=`${e.listbox.id||e.root.id||"combobox"}-option-${e.activeIndex}`),e.input.setAttribute("aria-activedescendant",t.id)}else e.input.removeAttribute("aria-activedescendant")},c=e=>{e.popover.dataset.empty=String(0===e.visibleOptions.length)},u=(e,{preserveActive:t=!1}={})=>{const i=e.activeIndex>-1?e.options[e.activeIndex]:null;if(e.visibleOptions=[],e.manualFilter)return e.visibleOptions=e.options.filter((e=>"true"!==e.getAttribute("aria-hidden"))),t&&i&&e.visibleOptions.includes(i)?a(e,e.options.indexOf(i)):a(e,e.autoHighlight&&e.visibleOptions.length>0?e.options.indexOf(e.visibleOptions[0]):-1),void c(e);const o=e.input.value.trim().toLowerCase();e.allOptions.forEach((t=>{if(t.hasAttribute("data-force"))return t.setAttribute("aria-hidden","false"),void(e.options.includes(t)&&e.visibleOptions.push(t));const i=(t.dataset.filter||t.dataset.label||t.textContent).trim().toLowerCase(),n=(t.dataset.keywords||"").toLowerCase().split(/[\s,]+/).filter(Boolean),l=!o||i.includes(o)||n.some((e=>e.includes(o)));t.setAttribute("aria-hidden",String(!l)),l&&e.options.includes(t)&&e.visibleOptions.push(t)})),t&&i&&e.visibleOptions.includes(i)?a(e,e.options.indexOf(i)):a(e,e.autoHighlight&&e.visibleOptions.length>0?e.options.indexOf(e.visibleOptions[0]):-1),c(e)},p=e=>{e.options.forEach((i=>{e.selected.has(t(i))?i.setAttribute("aria-selected","true"):i.removeAttribute("aria-selected")}))},d=(t,i,o=!0)=>{const a=e.get(t),c=(Array.isArray(i)?i:[i]).map(n).filter(Boolean);a.selected.clear(),a.isMultiple?(c.forEach((e=>a.selected.set(e.value,e))),a.input.value=""):c[0]?(a.selected.set(c[0].value,c[0]),a.input.value=c[0].label):a.input.value="",a.hiddenInput.value=(e=>{const t=l(e);if("object"===e.format)return JSON.stringify(e.isMultiple?t:t[0]||null);const i=t.map((e=>e.value));return e.isMultiple?JSON.stringify(i):i[0]||""})(a),p(a),a.isMultiple&&((t=>{const i=e.get(t);i.chips&&(i.chips.querySelectorAll(".combobox-chip").forEach((e=>e.remove())),l(i).forEach((e=>{const o=document.createElement("span");o.className="combobox-chip",o.dataset.value=e.value,o.textContent=e.label;const n=document.createElement("button");n.type="button",n.className="combobox-chip-remove",n.setAttribute("aria-label",`Remove ${e.label}`),n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',n.addEventListener("click",(()=>t.deselect(e.value))),o.appendChild(n),i.chips.insertBefore(o,i.input)})))})(t),u(a,{preserveActive:!0})),o&&t.dispatchEvent(new CustomEvent("change",{detail:{value:s(a),selected:r(a)},bubbles:!0}))},v=i=>{const l=e.get(i);if(!l)return;const s=(e=>{const t=e.querySelector(':scope > input[role="combobox"], :scope > .combobox-chips input[role="combobox"]'),i=e.querySelector(":scope > .combobox-chips"),o=e.querySelector(":scope > [data-popover]"),n=o?o.querySelector('[role="listbox"]'):null;return{input:t,chips:i,popover:o,listbox:n,hiddenInput:e.querySelector(':scope > input[type="hidden"]')}})(i);if(!(s.input&&s.popover&&s.listbox&&s.hiddenInput)){const e=[];return s.input||e.push("input"),s.popover||e.push("popover"),s.listbox||e.push("listbox"),s.hiddenInput||e.push("hidden input"),void console.error(`Combobox refresh failed. Missing element(s): ${e.join(", ")}`,i)}const r=s.hiddenInput.value,a=s.input.value;Object.assign(l,s,(e=>{const t=Array.from(e.querySelectorAll('[role="option"]'));return{allOptions:t,options:t.filter((e=>!(e=>"true"===e.getAttribute("aria-disabled"))(e)))}})(s.listbox)),l.isMultiple="true"===l.listbox.getAttribute("aria-multiselectable"),l.closeOnSelect="true"===i.dataset.closeOnSelect,l.autoHighlight="true"===i.dataset.autoHighlight,l.manualFilter="manual"===i.dataset.filter,l.format=(e=>"object"===e.dataset.format?"object":"value")(i);const c=((e,i,l)=>{if(l.isMultiple){let i=[];try{i=JSON.parse(e||"[]")}catch(e){i=[]}return Array.isArray(i)?i.map((e=>{const i=n("object"===l.format?e:{value:e,label:l.selected.get(String(e))?.label??e});if(!i)return null;const s=l.options.find((e=>t(e)===i.value));return s?o(s):i})).filter(Boolean):[]}if("object"===l.format)try{const i=n(JSON.parse(e||"null"));if(!i)return[];const s=l.options.find((e=>t(e)===i.value));return[s?o(s):i]}catch(e){return[]}const s=e||"";if(!s)return[];const r=l.options.find((e=>t(e)===s));return[r?o(r):{value:s,label:l.selected.get(s)?.label||i||s}]})(r,a,l);if(c.length>0)d(i,c,!1);else{const e=l.options.filter((e=>"true"===e.getAttribute("aria-selected"))).map(o);e.length>0?d(i,l.isMultiple?e:e[0],!1):l.isMultiple?d(i,[],!1):(l.input.value=a,l.selected.clear(),l.hiddenInput.value="",p(l),u(l,{preserveActive:!0}))}},b=(e,i)=>{if(i&&"object"==typeof i){const l=n(i);if(!l)return null;const s=e.options.find((e=>t(e)===l.value));return s?o(s):l}const l=e.options.find((e=>t(e)===i));if(l)return o(l);return e.selected.get(String(i))||null},f=i=>{if(i.dataset.comboboxInitialized)return;const c={root:i,activeIndex:-1,allOptions:[],options:[],visibleOptions:[],selected:new Map,format:"value",manualFilter:!1};if(e.set(i,c),i.refresh=()=>v(i),v(i),!(c.input&&c.popover&&c.listbox&&c.hiddenInput))return e.delete(i),void delete i.refresh;i.open=()=>{"false"!==c.popover.getAttribute("aria-hidden")&&(document.dispatchEvent(new CustomEvent("basecoat:popover",{detail:{source:i}})),i.refresh(),u(c),c.popover.setAttribute("aria-hidden","false"),c.input.setAttribute("aria-expanded","true"))},i.close=(e=!1)=>((e,t=!1)=>{"true"!==e.popover.getAttribute("aria-hidden")&&(e.popover.setAttribute("aria-hidden","true"),e.input.setAttribute("aria-expanded","false"),a(e,-1),t&&e.input.focus())})(c,e),i.select=t=>((t,i)=>{const o=e.get(t),n=b(o,i);n&&(o.isMultiple?(d(t,[...l(o).filter((e=>e.value!==n.value)),n]),o.closeOnSelect&&t.close(!0)):(d(t,n),t.close(!0)))})(i,t),i.selectByValue=i.select,i.setValue=e=>{const t=(c.isMultiple?Array.isArray(e)?e:null==e?[]:[e]:[e]).map((e=>b(c,e)||n(e))).filter(Boolean);d(i,c.isMultiple?t:t[0])},c.isMultiple&&(i.deselect=t=>((t,i)=>{const o=e.get(t);if(!o.isMultiple)return;const n=String(i);o.selected.has(n)&&d(t,l(o).filter((e=>e.value!==n)))})(i,t),i.toggle=e=>{const t=b(c,e);t&&(c.selected.has(t.value)?i.deselect(t.value):i.select(t))},i.selectAll=()=>d(i,c.options.map(o)),i.selectNone=()=>d(i,[]));const f=i.open,m=i.open,h=()=>{i.open(),u(c),c.isMultiple||(c.hiddenInput.value="",c.selected.clear(),p(c))},g=o=>((i,o)=>{const n=e.get(o);if(!["ArrowDown","ArrowUp","Enter","Home","End","Escape","Backspace"].includes(i.key))return;const s="false"===n.popover.getAttribute("aria-hidden");if("Backspace"===i.key&&n.isMultiple&&""===n.input.value){const e=l(n),t=e[e.length-1];return void(t&&o.deselect(t.value))}if("Escape"===i.key)return void o.close(!0);if(!s&&["ArrowDown","ArrowUp","Home","End"].includes(i.key)&&(i.preventDefault(),o.open()),"true"===n.popover.getAttribute("aria-hidden"))return;if("Enter"===i.key){if(n.activeIndex>-1){i.preventDefault();const e=n.options[n.activeIndex];n.isMultiple?o.toggle(t(e)):o.select(t(e))}return}if(!["ArrowDown","ArrowUp","Home","End"].includes(i.key)||0===n.visibleOptions.length)return;i.preventDefault();const r=n.activeIndex>-1?n.visibleOptions.indexOf(n.options[n.activeIndex]):-1;let c=r;"ArrowDown"===i.key&&(c=Math.min(r+1,n.visibleOptions.length-1)),"ArrowUp"===i.key&&(c=r<=0?0:r-1),"Home"===i.key&&(c=0),"End"===i.key&&(c=n.visibleOptions.length-1);const u=n.visibleOptions[c];a(n,n.options.indexOf(u)),((e,t)=>{const i=t.getBoundingClientRect(),o=e.listbox.getBoundingClientRect();i.top<o.top?e.listbox.scrollTop-=o.top-i.top:i.bottom>o.bottom&&(e.listbox.scrollTop+=i.bottom-o.bottom)})(n,u)})(o,i),x=e=>{const t=e.target.closest('[role="option"]');t&&c.visibleOptions.includes(t)&&a(c,c.options.indexOf(t))},A=e=>{const o=e.target.closest('[role="option"]');o&&c.options.includes(o)&&(c.isMultiple?i.toggle(t(o)):i.select(t(o)),c.isMultiple&&!c.closeOnSelect&&c.input.focus())},y=e=>{i.contains(e.target)||i.close(!1)},E=e=>{e.detail.source!==i&&i.close(!1)};c.input.addEventListener("focus",f),c.input.addEventListener("click",m),c.input.addEventListener("input",h),c.input.addEventListener("keydown",g),c.listbox.addEventListener("mousemove",x),c.listbox.addEventListener("click",A),document.addEventListener("click",y),document.addEventListener("basecoat:popover",E),i._destroy=()=>{c.input.removeEventListener("focus",f),c.input.removeEventListener("click",m),c.input.removeEventListener("input",h),c.input.removeEventListener("keydown",g),c.listbox.removeEventListener("mousemove",x),c.listbox.removeEventListener("click",A),document.removeEventListener("click",y),document.removeEventListener("basecoat:popover",E),c.chips?.querySelectorAll(".combobox-chip").forEach((e=>e.remove())),e.delete(i),delete i.refresh,delete i.open,delete i.close,delete i.select,delete i.selectByValue,delete i.setValue,delete i.deselect,delete i.toggle,delete i.selectAll,delete i.selectNone},c.popover.setAttribute("aria-hidden","true"),c.input.setAttribute("aria-expanded","false"),Object.defineProperty(i,"value",{configurable:!0,get:()=>s(c),set:e=>i.setValue(e)}),Object.defineProperty(i,"selected",{configurable:!0,get:()=>r(c)}),i.dataset.comboboxInitialized="true",i.dispatchEvent(new CustomEvent("basecoat:initialized"))};window.basecoat&&window.basecoat.register("combobox",{selector:".combobox:not([data-combobox-initialized])",init:f,refresh:v})})();
1
+ (()=>{const e=new WeakMap,t=e=>{const t=e.querySelector(":scope > [data-popover]"),i=e.querySelector(':scope > input[role="combobox"], :scope > .input-group input[role="combobox"], :scope > .combobox-chips input[role="combobox"]')||t?.querySelector('input[role="combobox"]'),o=e.querySelector(":scope > .combobox-chips"),n=e.querySelector(':scope > button[aria-haspopup="listbox"]'),l=n||e.querySelector(':scope > .input-group button[aria-haspopup="listbox"]'),s=e.querySelector("[data-clear]"),r=n?.querySelector("[data-value]")||(n?.matches("[data-value]")?n:null),a=t?t.querySelector('[role="listbox"]'):null;return{input:i,chips:o,trigger:l,clearButton:s,valueTarget:r,popover:t,listbox:a,hiddenInput:e.querySelector(':scope > input[type="hidden"]')}},i=e=>e.dataset.value??e.textContent.trim(),o=e=>e.dataset.label||e.textContent.trim(),n=e=>({value:i(e),label:o(e)}),l=e=>{if(e&&"object"==typeof e){const t=null==e.value?"":String(e.value);return t?{value:t,label:String(e.label??e.value)}:null}const t=null==e?"":String(e);return t?{value:t,label:t}:null},s=e=>Array.from(e.selected.values()),r=e=>e.isMultiple?s(e).map((e=>e.value)):s(e)[0]?.value||"",a=e=>e.isMultiple?s(e):s(e)[0]||null,u=(e,t)=>{if(e.activeIndex>-1&&e.options[e.activeIndex]&&e.options[e.activeIndex].classList.remove("active"),e.activeIndex=t,e.activeIndex>-1){const t=e.options[e.activeIndex];t.classList.add("active"),t.id||(t.id=`${e.listbox.id||e.root.id||"combobox"}-option-${e.activeIndex}`),e.input.setAttribute("aria-activedescendant",t.id)}else e.input.removeAttribute("aria-activedescendant")},c=e=>{e.popover.dataset.empty=String(0===e.visibleOptions.length)},p=(e,{preserveActive:t=!1,search:i}={})=>{const o=e.activeIndex>-1?e.options[e.activeIndex]:null;if(e.visibleOptions=[],e.manualFilter)return e.visibleOptions=e.options.filter((e=>"true"!==e.getAttribute("aria-hidden"))),t&&o&&e.visibleOptions.includes(o)?u(e,e.options.indexOf(o)):u(e,e.autoHighlight&&e.visibleOptions.length>0?e.options.indexOf(e.visibleOptions[0]):-1),void c(e);const n=(i??e.input.value).trim().toLowerCase();e.allOptions.forEach((t=>{if(t.hasAttribute("data-force"))return t.setAttribute("aria-hidden","false"),void(e.options.includes(t)&&e.visibleOptions.push(t));const i=(t.dataset.filter||t.dataset.label||t.textContent).trim().toLowerCase(),o=(t.dataset.keywords||"").toLowerCase().split(/[\s,]+/).filter(Boolean),l=!n||i.includes(n)||o.some((e=>e.includes(n)));t.setAttribute("aria-hidden",String(!l)),l&&e.options.includes(t)&&e.visibleOptions.push(t)})),t&&o&&e.visibleOptions.includes(o)?u(e,e.options.indexOf(o)):u(e,e.autoHighlight&&e.visibleOptions.length>0?e.options.indexOf(e.visibleOptions[0]):-1),c(e)},d=e=>{if(!e.valueTarget)return;const t=s(e);e.valueTarget.textContent=e.isMultiple?t.map((e=>e.label)).join(", "):t[0]?.label||e.valueTarget.dataset.placeholder||""},v=e=>{e.clearButton&&(e.clearButton.hidden=0===s(e).length&&""===e.input.value)},b=e=>{e.options.forEach((t=>{e.selected.has(i(t))?t.setAttribute("aria-selected","true"):t.removeAttribute("aria-selected")}))},f=(t,i,o=!0)=>{const n=e.get(t),u=(Array.isArray(i)?i:[i]).map(l).filter(Boolean);n.selected.clear(),n.isMultiple?(u.forEach((e=>n.selected.set(e.value,e))),n.input.value=""):u[0]?(n.selected.set(u[0].value,u[0]),n.input.value=n.valueTarget?"":u[0].label):n.input.value="",n.hiddenInput.value=(e=>{const t=s(e);if("object"===e.format)return JSON.stringify(e.isMultiple?t:t[0]||null);const i=t.map((e=>e.value));return e.isMultiple?JSON.stringify(i):i[0]||""})(n),b(n),n.isMultiple&&((t=>{const i=e.get(t);i.chips&&(i.chips.querySelectorAll(".combobox-chip").forEach((e=>e.remove())),s(i).forEach((e=>{const o=document.createElement("span");o.className="combobox-chip",o.dataset.value=e.value;const n=document.createElement("span");n.textContent=e.label;const l=document.createElement("button");l.type="button",l.className="combobox-chip-remove btn",l.dataset.variant="ghost",l.dataset.size="icon-xs",l.setAttribute("aria-label",`Remove ${e.label}`),l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',l.addEventListener("click",(o=>{o.stopPropagation(),t.deselect(e.value),i.input.focus()})),o.appendChild(n),o.appendChild(l),i.chips.insertBefore(o,i.input)})))})(t),p(n,{preserveActive:!0})),d(n),v(n),o&&t.dispatchEvent(new CustomEvent("change",{detail:{value:r(n),selected:a(n)},bubbles:!0}))},g=e=>{const{root:t}=e;if("false"===e.popover.getAttribute("aria-hidden"))return;document.dispatchEvent(new CustomEvent("basecoat:popover",{detail:{source:t}})),t.refresh();const i=s(e)[0];e.valueTarget&&(e.input.value="");const o=!e.isMultiple&&i&&e.input.value===i.label?"":void 0;p(e,{search:o}),e.popover.setAttribute("aria-hidden","false"),e.input.setAttribute("aria-expanded","true"),e.trigger?.setAttribute("aria-expanded","true"),e.trigger&&e.input.focus()},m=o=>{const s=e.get(o);if(!s)return;let r=t(o);if(!(r.input&&r.popover&&r.listbox&&r.hiddenInput)){const e=[];return r.input||e.push("input"),r.popover||e.push("popover"),r.listbox||e.push("listbox"),r.hiddenInput||e.push("hidden input"),void console.error(`Combobox refresh failed. Missing element(s): ${e.join(", ")}`,o)}r=((e,i)=>{if("true"!==i.listbox?.getAttribute("aria-multiselectable")||i.chips||!i.input)return i;if(i.input.parentElement!==e)return i;const o=document.createElement("div");return o.className="combobox-chips",e.insertBefore(o,i.input),o.appendChild(i.input),t(e)})(o,r);const a=r.hiddenInput.value,u=r.input.value;Object.assign(s,r,(e=>{const t=Array.from(e.querySelectorAll('[role="option"]'));return{allOptions:t,options:t.filter((e=>!(e=>"true"===e.getAttribute("aria-disabled"))(e)))}})(r.listbox)),s.isMultiple="true"===s.listbox.getAttribute("aria-multiselectable"),s.closeOnSelect="true"===o.dataset.closeOnSelect,s.autoHighlight="true"===o.dataset.autoHighlight,s.manualFilter="manual"===o.dataset.filter,s.format=(e=>"object"===e.dataset.format?"object":"value")(o);const c=((e,t,o)=>{if(o.isMultiple){let t=[];try{t=JSON.parse(e||"[]")}catch(e){t=[]}return Array.isArray(t)?t.map((e=>{const t=l("object"===o.format?e:{value:e,label:o.selected.get(String(e))?.label??e});if(!t)return null;const s=o.options.find((e=>i(e)===t.value));return s?n(s):t})).filter(Boolean):[]}if("object"===o.format)try{const t=l(JSON.parse(e||"null"));if(!t)return[];const s=o.options.find((e=>i(e)===t.value));return[s?n(s):t]}catch(e){return[]}const s=e||"";if(!s)return[];const r=o.options.find((e=>i(e)===s));return[r?n(r):{value:s,label:o.selected.get(s)?.label||t||s}]})(a,u,s);if(c.length>0)f(o,c,!1);else{const e=s.options.filter((e=>"true"===e.getAttribute("aria-selected"))).map(n);e.length>0?f(o,s.isMultiple?e:e[0],!1):s.isMultiple?f(o,[],!1):(s.input.value=u,s.selected.clear(),s.hiddenInput.value="",b(s),p(s,{preserveActive:!0}))}d(s),v(s)},h=(e,t)=>{if(t&&"object"==typeof t){const o=l(t);if(!o)return null;const s=e.options.find((e=>i(e)===o.value));return s?n(s):o}const o=e.options.find((e=>i(e)===t));if(o)return n(o);return e.selected.get(String(t))||null},x=t=>{const i=e.get(t);f(t,[],!0),i.input.value="",p(i),v(i),"false"===i.popover.getAttribute("aria-hidden")&&i.input.focus()},A=t=>{if(t.dataset.comboboxInitialized)return;const o={root:t,activeIndex:-1,allOptions:[],options:[],visibleOptions:[],selected:new Map,format:"value",manualFilter:!1,skipOpenOnFocus:!1};if(e.set(t,o),t.refresh=()=>m(t),m(t),!(o.input&&o.popover&&o.listbox&&o.hiddenInput))return e.delete(t),void delete t.refresh;t.close=(e=!1)=>((e,t=!1)=>{"true"!==e.popover.getAttribute("aria-hidden")&&(e.popover.setAttribute("aria-hidden","true"),e.input.setAttribute("aria-expanded","false"),e.trigger?.setAttribute("aria-expanded","false"),u(e,-1),t&&(e.skipOpenOnFocus=!0,e.input.focus(),requestAnimationFrame((()=>{e.skipOpenOnFocus=!1}))))})(o,e),t.select=i=>((t,i)=>{const o=e.get(t),n=h(o,i);n&&(o.isMultiple?(f(t,[...s(o).filter((e=>e.value!==n.value)),n]),o.closeOnSelect&&t.close(!0)):(f(t,n),t.close(!o.trigger),o.trigger?.focus()))})(t,i),t.selectByValue=t.select,t.setValue=e=>{const i=(o.isMultiple?Array.isArray(e)?e:null==e?[]:[e]:[e]).map((e=>h(o,e)||l(e))).filter(Boolean);f(t,o.isMultiple?i:i[0])},o.isMultiple&&(t.deselect=i=>((t,i)=>{const o=e.get(t);if(!o.isMultiple)return;const n=String(i);o.selected.has(n)&&f(t,s(o).filter((e=>e.value!==n)))})(t,i),t.toggle=e=>{const i=h(o,e);i&&(o.selected.has(i.value)?t.deselect(i.value):t.select(i))},t.selectAll=()=>f(t,o.options.map(n)),t.selectNone=()=>f(t,[]));const c=()=>{o.skipOpenOnFocus||g(o)},A=()=>g(o),y=()=>{g(o),p(o),o.isMultiple||(o.hiddenInput.value="",o.selected.clear(),b(o),d(o),v(o))},O=()=>{"false"===o.popover.getAttribute("aria-hidden")?t.close(!1):g(o)},E=e=>{e.preventDefault(),e.stopPropagation(),x(t)},k=o=>((t,o)=>{const n=e.get(o);if(!["ArrowDown","ArrowUp","Enter","Home","End","Escape","Backspace"].includes(t.key))return;const l="false"===n.popover.getAttribute("aria-hidden");if("Backspace"===t.key&&n.isMultiple&&""===n.input.value){const e=s(n),t=e[e.length-1];return void(t&&o.deselect(t.value))}if("Escape"===t.key)return void o.close(!0);if(!l&&["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),g(n)),"true"===n.popover.getAttribute("aria-hidden"))return;if("Enter"===t.key){if(n.activeIndex>-1){t.preventDefault();const e=n.options[n.activeIndex];n.isMultiple?o.toggle(i(e)):o.select(i(e))}return}if(!["ArrowDown","ArrowUp","Home","End"].includes(t.key)||0===n.visibleOptions.length)return;t.preventDefault();const r=n.activeIndex>-1?n.visibleOptions.indexOf(n.options[n.activeIndex]):-1;let a=r;"ArrowDown"===t.key&&(a=Math.min(r+1,n.visibleOptions.length-1)),"ArrowUp"===t.key&&(a=r<=0?0:r-1),"Home"===t.key&&(a=0),"End"===t.key&&(a=n.visibleOptions.length-1);const c=n.visibleOptions[a];u(n,n.options.indexOf(c)),((e,t)=>{const i=t.getBoundingClientRect(),o=e.listbox.getBoundingClientRect();i.top<o.top?e.listbox.scrollTop-=o.top-i.top:i.bottom>o.bottom&&(e.listbox.scrollTop+=i.bottom-o.bottom)})(n,c)})(o,t),w=e=>{const t=e.target.closest('[role="option"]');t&&o.visibleOptions.includes(t)&&u(o,o.options.indexOf(t))},S=e=>{const n=e.target.closest('[role="option"]');n&&o.options.includes(n)&&(o.isMultiple?t.toggle(i(n)):t.select(i(n)),o.isMultiple&&!o.closeOnSelect&&o.input.focus())},M=e=>{t.contains(e.target)||t.close(!1)},L=e=>{e.detail.source!==t&&t.close(!1)};o.input.addEventListener("focus",c),o.input.addEventListener("click",A),o.input.addEventListener("input",y),o.input.addEventListener("keydown",k),o.trigger?.addEventListener("click",O),o.clearButton?.addEventListener("click",E),o.listbox.addEventListener("mousemove",w),o.listbox.addEventListener("click",S),document.addEventListener("click",M),document.addEventListener("basecoat:popover",L),t._destroy=()=>{o.input.removeEventListener("focus",c),o.input.removeEventListener("click",A),o.input.removeEventListener("input",y),o.input.removeEventListener("keydown",k),o.trigger?.removeEventListener("click",O),o.clearButton?.removeEventListener("click",E),o.listbox.removeEventListener("mousemove",w),o.listbox.removeEventListener("click",S),document.removeEventListener("click",M),document.removeEventListener("basecoat:popover",L),o.chips?.querySelectorAll(".combobox-chip").forEach((e=>e.remove())),e.delete(t),delete t.refresh,delete t.close,delete t.select,delete t.selectByValue,delete t.setValue,delete t.clear,delete t.deselect,delete t.toggle,delete t.selectAll,delete t.selectNone},o.popover.setAttribute("aria-hidden","true"),o.input.setAttribute("aria-expanded","false"),o.trigger?.setAttribute("aria-expanded","false"),t.clear=()=>x(t),Object.defineProperty(t,"value",{configurable:!0,get:()=>r(o),set:e=>t.setValue(e)}),Object.defineProperty(t,"selected",{configurable:!0,get:()=>a(o)}),t.dataset.comboboxInitialized="true",t.dispatchEvent(new CustomEvent("basecoat:initialized"))};window.basecoat&&window.basecoat.register("combobox",{selector:".combobox:not([data-combobox-initialized])",init:A,refresh:m})})();
@@ -2,7 +2,9 @@
2
2
  const states = new WeakMap();
3
3
 
4
4
  const isDisabled = (item) =>
5
- item.hasAttribute('disabled') || item.getAttribute('aria-disabled') === 'true';
5
+ item.hasAttribute('disabled') ||
6
+ item.getAttribute('aria-disabled') === 'true' ||
7
+ item.getAttribute('data-disabled') === 'true';
6
8
 
7
9
  const getElements = (container) => ({
8
10
  input: container.querySelector('header input'),
@@ -1 +1 @@
1
- (()=>{const e=new WeakMap,t=e=>({input:e.querySelector("header input"),menu:e.querySelector('[role="menu"]')}),i=(e,t)=>{const i=t.getBoundingClientRect(),n=e.menu.getBoundingClientRect();i.top<n.top?e.menu.scrollTop-=n.top-i.top:i.bottom>n.bottom&&(e.menu.scrollTop+=i.bottom-n.bottom)},n=(e,t)=>{if(e.activeIndex>-1&&e.items[e.activeIndex]&&e.items[e.activeIndex].classList.remove("active"),e.activeIndex=t,e.activeIndex>-1){const t=e.items[e.activeIndex];t.classList.add("active"),t.id?e.input.setAttribute("aria-activedescendant",t.id):e.input.removeAttribute("aria-activedescendant")}else e.input.removeAttribute("aria-activedescendant")},s=e=>{if(e.manualFilter)return n(e,-1),e.visibleItems=e.items.filter((e=>"true"!==e.getAttribute("aria-hidden"))),void(e.visibleItems.length>0&&n(e,e.items.indexOf(e.visibleItems[0])));const t=e.input.value.trim().toLowerCase();n(e,-1),e.visibleItems=[],e.allItems.forEach((i=>{if(i.hasAttribute("data-force"))return i.setAttribute("aria-hidden","false"),void(e.items.includes(i)&&e.visibleItems.push(i));const n=(i.dataset.filter||i.textContent).trim().toLowerCase(),s=(i.dataset.keywords||"").toLowerCase().split(/[\s,]+/).filter(Boolean).some((e=>e.includes(t))),o=n.includes(t)||s;i.setAttribute("aria-hidden",String(!o)),o&&e.items.includes(i)&&e.visibleItems.push(i)})),e.visibleItems.length>0&&(n(e,e.items.indexOf(e.visibleItems[0])),i(e,e.visibleItems[0]))},o=i=>{const n=e.get(i);if(!n)return;const o=t(i);if(!o.input||!o.menu){const e=[];return o.input||e.push("input"),o.menu||e.push("menu"),void console.error(`Command component refresh failed. Missing element(s): ${e.join(", ")}`,i)}Object.assign(n,o,(e=>{const t=Array.from(e.querySelectorAll('[role="menuitem"]'));return{allItems:t,items:t.filter((e=>!(e=>e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"))(e)))}})(o.menu)),n.manualFilter="manual"===i.dataset.filter,s(n)},r=r=>{if(r.dataset.commandInitialized)return;const a={activeIndex:-1,allItems:[],items:[],visibleItems:[],manualFilter:!1};e.set(r,a),r.refresh=()=>o(r);const m=t(r);if(!m.input||!m.menu){const t=[];return m.input||t.push("input"),m.menu||t.push("menu"),console.error(`Command component initialization failed. Missing element(s): ${t.join(", ")}`,r),e.delete(r),void delete r.refresh}Object.assign(a,m);const l=()=>s(a),d=e=>((e,t)=>{if(!["ArrowDown","ArrowUp","Enter","Home","End"].includes(e.key))return;if("Enter"===e.key)return e.preventDefault(),void(t.activeIndex>-1&&t.items[t.activeIndex]?.click());if(0===t.visibleItems.length)return;e.preventDefault();const s=t.activeIndex>-1?t.visibleItems.indexOf(t.items[t.activeIndex]):-1;let o=s;if("ArrowDown"===e.key&&s<t.visibleItems.length-1&&(o=s+1),"ArrowUp"===e.key&&(o=s>0?s-1:0),"Home"===e.key&&(o=0),"End"===e.key&&(o=t.visibleItems.length-1),o!==s){const e=t.visibleItems[o];n(t,t.items.indexOf(e)),i(t,e)}})(e,a),u=e=>{const t=e.target.closest('[role="menuitem"]');if(t&&a.visibleItems.includes(t)){const e=a.items.indexOf(t);e!==a.activeIndex&&n(a,e)}},c=e=>{const t=e.target.closest('[role="menuitem"]');if(t&&a.visibleItems.includes(t)){const e=r.closest("dialog.command-dialog");e&&!t.hasAttribute("data-keep-command-open")&&e.close()}};a.input.addEventListener("input",l),a.input.addEventListener("keydown",d),a.menu.addEventListener("mousemove",u),a.menu.addEventListener("click",c),r._destroy=()=>{a.input.removeEventListener("input",l),a.input.removeEventListener("keydown",d),a.menu.removeEventListener("mousemove",u),a.menu.removeEventListener("click",c),e.delete(r),delete r.refresh},o(r),r.dataset.commandInitialized="true",r.dispatchEvent(new CustomEvent("basecoat:initialized"))};window.basecoat&&window.basecoat.register("command",{selector:".command:not([data-command-initialized])",init:r,refresh:o})})();
1
+ (()=>{const e=new WeakMap,t=e=>({input:e.querySelector("header input"),menu:e.querySelector('[role="menu"]')}),i=(e,t)=>{const i=t.getBoundingClientRect(),n=e.menu.getBoundingClientRect();i.top<n.top?e.menu.scrollTop-=n.top-i.top:i.bottom>n.bottom&&(e.menu.scrollTop+=i.bottom-n.bottom)},n=(e,t)=>{if(e.activeIndex>-1&&e.items[e.activeIndex]&&e.items[e.activeIndex].classList.remove("active"),e.activeIndex=t,e.activeIndex>-1){const t=e.items[e.activeIndex];t.classList.add("active"),t.id?e.input.setAttribute("aria-activedescendant",t.id):e.input.removeAttribute("aria-activedescendant")}else e.input.removeAttribute("aria-activedescendant")},s=e=>{if(e.manualFilter)return n(e,-1),e.visibleItems=e.items.filter((e=>"true"!==e.getAttribute("aria-hidden"))),void(e.visibleItems.length>0&&n(e,e.items.indexOf(e.visibleItems[0])));const t=e.input.value.trim().toLowerCase();n(e,-1),e.visibleItems=[],e.allItems.forEach((i=>{if(i.hasAttribute("data-force"))return i.setAttribute("aria-hidden","false"),void(e.items.includes(i)&&e.visibleItems.push(i));const n=(i.dataset.filter||i.textContent).trim().toLowerCase(),s=(i.dataset.keywords||"").toLowerCase().split(/[\s,]+/).filter(Boolean).some((e=>e.includes(t))),r=n.includes(t)||s;i.setAttribute("aria-hidden",String(!r)),r&&e.items.includes(i)&&e.visibleItems.push(i)})),e.visibleItems.length>0&&(n(e,e.items.indexOf(e.visibleItems[0])),i(e,e.visibleItems[0]))},r=i=>{const n=e.get(i);if(!n)return;const r=t(i);if(!r.input||!r.menu){const e=[];return r.input||e.push("input"),r.menu||e.push("menu"),void console.error(`Command component refresh failed. Missing element(s): ${e.join(", ")}`,i)}Object.assign(n,r,(e=>{const t=Array.from(e.querySelectorAll('[role="menuitem"]'));return{allItems:t,items:t.filter((e=>!(e=>e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")||"true"===e.getAttribute("data-disabled"))(e)))}})(r.menu)),n.manualFilter="manual"===i.dataset.filter,s(n)},o=o=>{if(o.dataset.commandInitialized)return;const a={activeIndex:-1,allItems:[],items:[],visibleItems:[],manualFilter:!1};e.set(o,a),o.refresh=()=>r(o);const m=t(o);if(!m.input||!m.menu){const t=[];return m.input||t.push("input"),m.menu||t.push("menu"),console.error(`Command component initialization failed. Missing element(s): ${t.join(", ")}`,o),e.delete(o),void delete o.refresh}Object.assign(a,m);const d=()=>s(a),l=e=>((e,t)=>{if(!["ArrowDown","ArrowUp","Enter","Home","End"].includes(e.key))return;if("Enter"===e.key)return e.preventDefault(),void(t.activeIndex>-1&&t.items[t.activeIndex]?.click());if(0===t.visibleItems.length)return;e.preventDefault();const s=t.activeIndex>-1?t.visibleItems.indexOf(t.items[t.activeIndex]):-1;let r=s;if("ArrowDown"===e.key&&s<t.visibleItems.length-1&&(r=s+1),"ArrowUp"===e.key&&(r=s>0?s-1:0),"Home"===e.key&&(r=0),"End"===e.key&&(r=t.visibleItems.length-1),r!==s){const e=t.visibleItems[r];n(t,t.items.indexOf(e)),i(t,e)}})(e,a),u=e=>{const t=e.target.closest('[role="menuitem"]');if(t&&a.visibleItems.includes(t)){const e=a.items.indexOf(t);e!==a.activeIndex&&n(a,e)}},c=e=>{const t=e.target.closest('[role="menuitem"]');if(t&&a.visibleItems.includes(t)){const e=o.closest("dialog.command-dialog");e&&!t.hasAttribute("data-keep-command-open")&&e.close()}};a.input.addEventListener("input",d),a.input.addEventListener("keydown",l),a.menu.addEventListener("mousemove",u),a.menu.addEventListener("click",c),o._destroy=()=>{a.input.removeEventListener("input",d),a.input.removeEventListener("keydown",l),a.menu.removeEventListener("mousemove",u),a.menu.removeEventListener("click",c),e.delete(o),delete o.refresh},r(o),o.dataset.commandInitialized="true",o.dispatchEvent(new CustomEvent("basecoat:initialized"))};window.basecoat&&window.basecoat.register("command",{selector:".command:not([data-command-initialized])",init:o,refresh:r})})();
@@ -146,7 +146,18 @@
146
146
  const handleMenuMouseleave = () => setActiveItem(state, -1);
147
147
  const handleMenuClick = (event) => {
148
148
  const menuItem = event.target.closest('[role^="menuitem"]');
149
- if (menuItem && !isDisabled(menuItem)) root.close();
149
+ if (!menuItem || isDisabled(menuItem)) return;
150
+
151
+ if (menuItem.getAttribute('role') === 'menuitemcheckbox') {
152
+ menuItem.setAttribute('aria-checked', menuItem.getAttribute('aria-checked') !== 'true');
153
+ } else if (menuItem.getAttribute('role') === 'menuitemradio') {
154
+ const group = menuItem.closest('[role="group"], [role="menu"]');
155
+ group?.querySelectorAll('[role="menuitemradio"]').forEach((item) => {
156
+ if (!isDisabled(item)) item.setAttribute('aria-checked', item === menuItem ? 'true' : 'false');
157
+ });
158
+ }
159
+
160
+ root.close();
150
161
  };
151
162
 
152
163
  const handleDocumentClick = (event) => {
@@ -1 +1 @@
1
- (()=>{const e=new WeakMap,t=e=>e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"),r=(e,t)=>{if(e.activeIndex>-1&&e.items[e.activeIndex]&&e.items[e.activeIndex].classList.remove("active"),e.activeIndex=t,e.activeIndex>-1&&e.items[e.activeIndex]){const t=e.items[e.activeIndex];t.classList.add("active"),t.id&&e.trigger.setAttribute("aria-activedescendant",t.id)}else e.trigger.removeAttribute("aria-activedescendant")},i=i=>{const n=e.get(i);if(!n)return;const o=(e=>{const t=e.querySelector(":scope > button"),r=e.querySelector(":scope > [data-popover]"),i=r?r.querySelector('[role="menu"]'):null;return{trigger:t,popover:r,menu:i}})(i);if(!o.trigger||!o.popover||!o.menu){const e=[];return o.trigger||e.push("trigger"),o.popover||e.push("popover"),o.menu||e.push("menu"),void console.error(`Dropdown menu refresh failed. Missing element(s): ${e.join(", ")}`,i)}var a;Object.assign(n,o),n.items=(a=n.menu,Array.from(a.querySelectorAll('[role^="menuitem"]')).filter((e=>!t(e)))),n.activeIndex>-1&&!n.items[n.activeIndex]&&r(n,-1)},n=n=>{if(n.dataset.dropdownMenuInitialized)return;const o={activeIndex:-1,items:[]};if(e.set(n,o),n.refresh=()=>i(n),i(n),!o.trigger||!o.popover||!o.menu)return e.delete(n),void delete n.refresh;n.open=(e=!1)=>((e,t,i=!1)=>{document.dispatchEvent(new CustomEvent("basecoat:popover",{detail:{source:e}})),e.refresh(),t.trigger.setAttribute("aria-expanded","true"),t.popover.setAttribute("aria-hidden","false"),t.items.length>0&&i&&r(t,"last"===i?t.items.length-1:0)})(n,o,e),n.close=(e=!0)=>((e,t=!0)=>{"false"!==e.trigger.getAttribute("aria-expanded")&&(e.trigger.setAttribute("aria-expanded","false"),e.trigger.removeAttribute("aria-activedescendant"),e.popover.setAttribute("aria-hidden","true"),t&&e.trigger.focus(),r(e,-1))})(o,e),n.toggle=()=>"true"===o.trigger.getAttribute("aria-expanded")?n.close():n.open(!1);const a=n.toggle,s=e=>{const t="true"===o.trigger.getAttribute("aria-expanded");if("Escape"===e.key)return void(t&&n.close());if(!t)return void(["Enter"," "].includes(e.key)?(e.preventDefault(),n.open(!1)):"ArrowDown"===e.key?(e.preventDefault(),n.open("first")):"ArrowUp"===e.key&&(e.preventDefault(),n.open("last")));if(0===o.items.length)return;let i=o.activeIndex;if("ArrowDown"===e.key)e.preventDefault(),i=-1===o.activeIndex?0:Math.min(o.activeIndex+1,o.items.length-1);else if("ArrowUp"===e.key)e.preventDefault(),i=-1===o.activeIndex?o.items.length-1:Math.max(o.activeIndex-1,0);else if("Home"===e.key)e.preventDefault(),i=0;else{if("End"!==e.key)return["Enter"," "].includes(e.key)?(e.preventDefault(),o.items[o.activeIndex]?.click(),void n.close()):void 0;e.preventDefault(),i=o.items.length-1}i!==o.activeIndex&&r(o,i)},d=e=>{const i=e.target.closest('[role^="menuitem"]');if(i&&!t(i)&&o.items.includes(i)){const e=o.items.indexOf(i);e!==o.activeIndex&&r(o,e)}},c=()=>r(o,-1),u=e=>{const r=e.target.closest('[role^="menuitem"]');r&&!t(r)&&n.close()},l=e=>{n.contains(e.target)||n.close(!1)},v=e=>{e.detail.source!==n&&n.close(!1)};o.trigger.addEventListener("click",a),n.addEventListener("keydown",s),o.menu.addEventListener("mousemove",d),o.menu.addEventListener("mouseleave",c),o.menu.addEventListener("click",u),document.addEventListener("click",l),document.addEventListener("basecoat:popover",v),n._destroy=()=>{o.trigger.removeEventListener("click",a),n.removeEventListener("keydown",s),o.menu.removeEventListener("mousemove",d),o.menu.removeEventListener("mouseleave",c),o.menu.removeEventListener("click",u),document.removeEventListener("click",l),document.removeEventListener("basecoat:popover",v),e.delete(n),delete n.refresh,delete n.open,delete n.close,delete n.toggle},o.trigger.setAttribute("aria-expanded","false"),o.popover.setAttribute("aria-hidden","true"),n.dataset.dropdownMenuInitialized="true",n.dispatchEvent(new CustomEvent("basecoat:initialized"))};window.basecoat&&window.basecoat.register("dropdown-menu",{selector:".dropdown-menu:not([data-dropdown-menu-initialized])",init:n,refresh:i})})();
1
+ (()=>{const e=new WeakMap,t=e=>e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"),r=(e,t)=>{if(e.activeIndex>-1&&e.items[e.activeIndex]&&e.items[e.activeIndex].classList.remove("active"),e.activeIndex=t,e.activeIndex>-1&&e.items[e.activeIndex]){const t=e.items[e.activeIndex];t.classList.add("active"),t.id&&e.trigger.setAttribute("aria-activedescendant",t.id)}else e.trigger.removeAttribute("aria-activedescendant")},i=i=>{const n=e.get(i);if(!n)return;const o=(e=>{const t=e.querySelector(":scope > button"),r=e.querySelector(":scope > [data-popover]"),i=r?r.querySelector('[role="menu"]'):null;return{trigger:t,popover:r,menu:i}})(i);if(!o.trigger||!o.popover||!o.menu){const e=[];return o.trigger||e.push("trigger"),o.popover||e.push("popover"),o.menu||e.push("menu"),void console.error(`Dropdown menu refresh failed. Missing element(s): ${e.join(", ")}`,i)}var a;Object.assign(n,o),n.items=(a=n.menu,Array.from(a.querySelectorAll('[role^="menuitem"]')).filter((e=>!t(e)))),n.activeIndex>-1&&!n.items[n.activeIndex]&&r(n,-1)},n=n=>{if(n.dataset.dropdownMenuInitialized)return;const o={activeIndex:-1,items:[]};if(e.set(n,o),n.refresh=()=>i(n),i(n),!o.trigger||!o.popover||!o.menu)return e.delete(n),void delete n.refresh;n.open=(e=!1)=>((e,t,i=!1)=>{document.dispatchEvent(new CustomEvent("basecoat:popover",{detail:{source:e}})),e.refresh(),t.trigger.setAttribute("aria-expanded","true"),t.popover.setAttribute("aria-hidden","false"),t.items.length>0&&i&&r(t,"last"===i?t.items.length-1:0)})(n,o,e),n.close=(e=!0)=>((e,t=!0)=>{"false"!==e.trigger.getAttribute("aria-expanded")&&(e.trigger.setAttribute("aria-expanded","false"),e.trigger.removeAttribute("aria-activedescendant"),e.popover.setAttribute("aria-hidden","true"),t&&e.trigger.focus(),r(e,-1))})(o,e),n.toggle=()=>"true"===o.trigger.getAttribute("aria-expanded")?n.close():n.open(!1);const a=n.toggle,s=e=>{const t="true"===o.trigger.getAttribute("aria-expanded");if("Escape"===e.key)return void(t&&n.close());if(!t)return void(["Enter"," "].includes(e.key)?(e.preventDefault(),n.open(!1)):"ArrowDown"===e.key?(e.preventDefault(),n.open("first")):"ArrowUp"===e.key&&(e.preventDefault(),n.open("last")));if(0===o.items.length)return;let i=o.activeIndex;if("ArrowDown"===e.key)e.preventDefault(),i=-1===o.activeIndex?0:Math.min(o.activeIndex+1,o.items.length-1);else if("ArrowUp"===e.key)e.preventDefault(),i=-1===o.activeIndex?o.items.length-1:Math.max(o.activeIndex-1,0);else if("Home"===e.key)e.preventDefault(),i=0;else{if("End"!==e.key)return["Enter"," "].includes(e.key)?(e.preventDefault(),o.items[o.activeIndex]?.click(),void n.close()):void 0;e.preventDefault(),i=o.items.length-1}i!==o.activeIndex&&r(o,i)},d=e=>{const i=e.target.closest('[role^="menuitem"]');if(i&&!t(i)&&o.items.includes(i)){const e=o.items.indexOf(i);e!==o.activeIndex&&r(o,e)}},c=()=>r(o,-1),u=e=>{const r=e.target.closest('[role^="menuitem"]');if(r&&!t(r)){if("menuitemcheckbox"===r.getAttribute("role"))r.setAttribute("aria-checked","true"!==r.getAttribute("aria-checked"));else if("menuitemradio"===r.getAttribute("role")){const e=r.closest('[role="group"], [role="menu"]');e?.querySelectorAll('[role="menuitemradio"]').forEach((e=>{t(e)||e.setAttribute("aria-checked",e===r?"true":"false")}))}n.close()}},l=e=>{n.contains(e.target)||n.close(!1)},v=e=>{e.detail.source!==n&&n.close(!1)};o.trigger.addEventListener("click",a),n.addEventListener("keydown",s),o.menu.addEventListener("mousemove",d),o.menu.addEventListener("mouseleave",c),o.menu.addEventListener("click",u),document.addEventListener("click",l),document.addEventListener("basecoat:popover",v),n._destroy=()=>{o.trigger.removeEventListener("click",a),n.removeEventListener("keydown",s),o.menu.removeEventListener("mousemove",d),o.menu.removeEventListener("mouseleave",c),o.menu.removeEventListener("click",u),document.removeEventListener("click",l),document.removeEventListener("basecoat:popover",v),e.delete(n),delete n.refresh,delete n.open,delete n.close,delete n.toggle},o.trigger.setAttribute("aria-expanded","false"),o.popover.setAttribute("aria-hidden","true"),n.dataset.dropdownMenuInitialized="true",n.dispatchEvent(new CustomEvent("basecoat:initialized"))};window.basecoat&&window.basecoat.register("dropdown-menu",{selector:".dropdown-menu:not([data-dropdown-menu-initialized])",init:n,refresh:i})})();
@@ -1,5 +1,26 @@
1
- /* Button */
1
+ /* Accordion */
2
2
  @layer components {
3
+ .accordion {
4
+ @apply overflow-hidden rounded-2xl border;
5
+ }
6
+
7
+ .accordion > details {
8
+ @apply open:bg-muted/50 not-last:border-b;
9
+ }
10
+
11
+ .accordion > details > summary {
12
+ @apply gap-6 p-4 text-left text-sm font-medium hover:underline;
13
+ }
14
+
15
+ .accordion > details > summary > svg:last-child {
16
+ @apply text-muted-foreground ms-auto size-4;
17
+ }
18
+
19
+ .accordion > details > :not(summary) {
20
+ @apply px-4 pt-0 pb-4 text-sm;
21
+ }
22
+
23
+ /* Button */
3
24
  .btn {
4
25
  @apply rounded-4xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-[3px] aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4;
5
26
  }
@@ -255,7 +276,7 @@
255
276
  @apply size-10;
256
277
  }
257
278
 
258
- .avatar > span:not([data-badge]) {
279
+ .avatar > span:not(.avatar-badge) {
259
280
  @apply bg-muted text-muted-foreground rounded-[inherit];
260
281
  }
261
282
 
@@ -263,7 +284,7 @@
263
284
  @apply rounded-[inherit];
264
285
  }
265
286
 
266
- .avatar > [data-badge] {
287
+ .avatar > .avatar-badge {
267
288
  @apply bg-primary text-primary-foreground ring-background;
268
289
  }
269
290
 
@@ -309,17 +330,42 @@
309
330
  @apply text-primary underline-offset-4 hover:underline;
310
331
  }
311
332
 
333
+ /* Breadcrumb */
334
+ .breadcrumb > ol {
335
+ @apply text-muted-foreground gap-1.5 text-sm sm:gap-2.5;
336
+ }
337
+
338
+ .breadcrumb li {
339
+ @apply gap-1.5;
340
+ }
341
+
342
+ .breadcrumb a {
343
+ @apply transition-colors hover:text-foreground;
344
+ }
345
+
346
+ .breadcrumb [aria-current='page'] {
347
+ @apply font-normal text-foreground;
348
+ }
349
+
350
+ .breadcrumb li[aria-hidden='true'] > svg {
351
+ @apply size-3.5;
352
+ }
353
+
354
+ .breadcrumb li > span[aria-hidden='true'] {
355
+ @apply size-5 [&>svg]:size-4;
356
+ }
357
+
312
358
  /* Command */
313
359
  .command {
314
- @apply bg-popover text-popover-foreground rounded-4xl p-1;
360
+ @apply bg-popover text-popover-foreground rounded-4xl! p-1;
315
361
  }
316
362
 
317
- .command-dialog > * {
318
- @apply rounded-4xl p-0;
363
+ .command-dialog > .command {
364
+ @apply bg-popover text-popover-foreground ring-foreground/5 dark:ring-foreground/10 rounded-4xl! shadow-xl ring-1 duration-100;
319
365
  }
320
366
 
321
367
  .command > header {
322
- @apply m-1 mb-0 h-9 gap-2 rounded-3xl bg-input/50 px-3;
368
+ @apply m-1 mb-0 h-9 gap-0 rounded-3xl bg-input/50 px-3;
323
369
  }
324
370
 
325
371
  .command > header svg {
@@ -327,7 +373,7 @@
327
373
  }
328
374
 
329
375
  .command > header input {
330
- @apply h-full text-sm placeholder:text-muted-foreground;
376
+ @apply ps-1.5 text-sm placeholder:text-muted-foreground;
331
377
  }
332
378
 
333
379
  .command [role='menu'] {
@@ -355,7 +401,7 @@
355
401
  }
356
402
 
357
403
  .command [role='menuitem'].active {
358
- @apply bg-accent text-accent-foreground [&_svg]:text-accent-foreground;
404
+ @apply bg-muted text-foreground [&_svg]:text-foreground;
359
405
  }
360
406
 
361
407
  .command [data-shortcut] {
@@ -421,6 +467,10 @@
421
467
  .combobox-chip-remove {
422
468
  @apply -ms-1 opacity-50 hover:opacity-100 [&_svg]:size-3.5;
423
469
  }
470
+
471
+ .combobox [data-popover] > :is(input[role='combobox'], .input-group) {
472
+ @apply mb-1 w-full;
473
+ }
424
474
  /* Select */
425
475
  *:not(select).select > button {
426
476
  @apply bg-input/50 border-transparent focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 data-[size=sm]:h-8 gap-1.5 rounded-3xl border px-3 py-2 text-sm transition-[color,box-shadow,background-color] focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4;
@@ -473,10 +523,15 @@
473
523
 
474
524
  /* Dialog */
475
525
  .dialog::backdrop,
526
+ .alert-dialog::backdrop,
476
527
  .command-dialog::backdrop {
477
528
  @apply bg-black/30 backdrop-blur-sm duration-100;
478
529
  }
479
530
 
531
+ .alert-dialog > * {
532
+ @apply bg-popover text-popover-foreground ring-foreground/5 dark:ring-foreground/10 max-w-xs gap-6 rounded-4xl p-6 shadow-xl ring-1 duration-100 sm:max-w-md;
533
+ }
534
+
480
535
  .dialog > * {
481
536
  @apply bg-popover text-popover-foreground ring-foreground/5 dark:ring-foreground/10 max-w-[calc(100%-2rem)] gap-6 rounded-4xl p-6 text-sm shadow-xl ring-1 duration-100 sm:max-w-md;
482
537
  }
@@ -493,6 +548,15 @@
493
548
  @apply gap-1.5;
494
549
  }
495
550
 
551
+ .alert-dialog > * > header {
552
+ @apply gap-x-6 gap-y-1.5;
553
+ }
554
+
555
+ .alert-dialog > * > header > figure {
556
+ @apply bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-full [&>svg:not([class*='size-'])]:size-8;
557
+ }
558
+
559
+ .alert-dialog > * > footer,
496
560
  .dialog > * > footer {
497
561
  @apply gap-2;
498
562
  }
@@ -502,11 +566,21 @@
502
566
  @apply text-base leading-none font-medium;
503
567
  }
504
568
 
569
+ .alert-dialog > * > header > h2,
570
+ .alert-dialog > * > [data-title] {
571
+ @apply text-lg font-medium;
572
+ }
573
+
505
574
  .dialog > * > header > p,
506
575
  .dialog > * > [data-description] {
507
576
  @apply text-muted-foreground text-sm leading-normal [&_a]:underline [&_a]:underline-offset-3 [&_a:hover]:text-foreground;
508
577
  }
509
578
 
579
+ .alert-dialog > * > header > p,
580
+ .alert-dialog > * > [data-description] {
581
+ @apply text-muted-foreground text-sm text-balance md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a:hover]:text-foreground;
582
+ }
583
+
510
584
  /* Dropdown Menu */
511
585
  .dropdown-menu > [data-popover] {
512
586
  @apply bg-popover text-popover-foreground ring-foreground/5 dark:ring-foreground/10 min-w-48 gap-0 overflow-x-hidden overflow-y-auto rounded-3xl p-1.5 shadow-lg ring-1 duration-100;
@@ -553,11 +627,11 @@
553
627
  @apply bg-border/50 -mx-1.5 my-1.5 h-px;
554
628
  }
555
629
 
556
- .dropdown-menu :is([data-shortcut], kbd:last-child) {
630
+ .dropdown-menu :is([data-shortcut], kbd:last-child, .kbd:last-child) {
557
631
  @apply text-muted-foreground font-sans text-xs tracking-widest;
558
632
  }
559
633
 
560
- .dropdown-menu :is([role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']):is(:focus-visible, .active) :is([data-shortcut], kbd:last-child) {
634
+ .dropdown-menu :is([role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']):is(:focus-visible, .active) :is([data-shortcut], kbd:last-child, .kbd:last-child) {
561
635
  @apply text-accent-foreground;
562
636
  }
563
637