daub-ui 2.6.0 → 2.7.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 CHANGED
@@ -3,9 +3,11 @@
3
3
  **Considered CSS components for discerning interfaces.**
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-C67B5C.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-2.6.0-3D3832.svg)](https://daub.dev)
6
+ [![Version](https://img.shields.io/badge/version-2.7.0-3D3832.svg)](https://daub.dev)
7
7
  [![Components](https://img.shields.io/badge/components-76-D4C4A8.svg)](https://daub.dev)
8
8
 
9
+ ![CleanShot 2026-03-02 at 16 07 28 - 02](https://github.com/user-attachments/assets/5ddefcde-6f79-4175-b9c4-fc20005c551d)
10
+
9
11
  [Live Demo](https://daub.dev) | [Layout Demos](https://daub.dev/demo.html) | [AI Docs](https://daub.dev/llms.txt)
10
12
 
11
13
  ---
@@ -25,8 +27,8 @@ A drop-in CSS + JS component library with a tactile, handcrafted aesthetic. 76 c
25
27
 
26
28
  Alternative CDNs (npm package: `daub-ui`):
27
29
  ```html
28
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daub-ui@2.6.0/daub.css">
29
- <script src="https://cdn.jsdelivr.net/npm/daub-ui@2.6.0/daub.js"></script>
30
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daub-ui@latest/daub.css">
31
+ <script src="https://cdn.jsdelivr.net/npm/daub-ui@latest/daub.js"></script>
30
32
  ```
31
33
 
32
34
  ### Download
@@ -49,7 +51,7 @@ DAUB uses system font stacks by default. For richer typography:
49
51
  }
50
52
  </style>
51
53
 
52
- <!-- Lucide Icons (used in demos, not required) -->
54
+ <!-- Lucide Icons (recommended — used in all demos) -->
53
55
  <script src="https://unpkg.com/lucide@latest"></script>
54
56
  ```
55
57
 
@@ -367,7 +369,7 @@ No polyfills needed.
367
369
 
368
370
  See [CHANGELOG.md](CHANGELOG.md) for the full release history.
369
371
 
370
- **Latest: v2.6.0** — Dashboard primitives, table utilities, getColor helper. 76 components, 20 theme families.
372
+ **Latest: v2.7.0** — Overlay skeletons, tooltip fix, dropdown alias, better warnings. 76 components, 20 theme families.
371
373
 
372
374
  ## License
373
375
 
package/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.3.0",
2
+ "version": "2.7.0",
3
3
  "prefix": "db-",
4
4
  "cdn": {
5
5
  "css": "https://daub.dev/daub.css",
@@ -284,6 +284,7 @@
284
284
  ],
285
285
  "js": true,
286
286
  "html": "<div class=\"db-tabs\">\n <div class=\"db-tabs__list\" role=\"tablist\">\n <button class=\"db-tabs__tab\" aria-selected=\"true\">Tab 1</button>\n <button class=\"db-tabs__tab\">Tab 2</button>\n </div>\n <div class=\"db-tabs__panel\">Content 1</div>\n <div class=\"db-tabs__panel\" hidden>Content 2</div>\n</div>",
287
+ "skeleton": "db-tabs > __list[role=tablist] > __tab + __panel",
287
288
  "notes": "JS handles tab switching and panel visibility."
288
289
  },
289
290
  {
@@ -319,6 +320,7 @@
319
320
  ],
320
321
  "js": true,
321
322
  "html": "<div class=\"db-modal-overlay\" id=\"my-modal\" aria-hidden=\"true\">\n <div class=\"db-modal\">\n <div class=\"db-modal__header\">\n <h2 class=\"db-modal__title\">Title</h2>\n <button class=\"db-modal__close\" aria-label=\"Close\">&times;</button>\n </div>\n <div class=\"db-modal__body\">Content</div>\n <div class=\"db-modal__footer\">\n <button class=\"db-btn db-btn--primary\">Confirm</button>\n </div>\n </div>\n</div>",
323
+ "skeleton": "db-modal-overlay#id[aria-hidden] > db-modal > __header + __body + __footer",
322
324
  "notes": "Wrap in db-modal-overlay with id. Open: DAUB.openModal('id'). Close: DAUB.closeModal('id')."
323
325
  },
324
326
  {
@@ -330,6 +332,7 @@
330
332
  "children": [],
331
333
  "js": true,
332
334
  "html": "<div class=\"db-modal-overlay\" id=\"my-modal\" aria-hidden=\"true\">\n <div class=\"db-modal\">...</div>\n</div>",
335
+ "skeleton": "db-modal-overlay#id[aria-hidden] > db-modal > __header + __body + __footer",
333
336
  "notes": "Container for db-modal. Must have an id attribute for JS API."
334
337
  },
335
338
  {
@@ -347,6 +350,7 @@
347
350
  ],
348
351
  "js": true,
349
352
  "html": "<div class=\"db-alert-dialog\" id=\"confirm-delete\">\n <div class=\"db-alert-dialog__overlay\"></div>\n <div class=\"db-alert-dialog__panel\">\n <h3 class=\"db-alert-dialog__title\">Are you sure?</h3>\n <p class=\"db-alert-dialog__desc\">This action cannot be undone.</p>\n <div class=\"db-alert-dialog__actions\">\n <button class=\"db-btn db-btn--secondary\" data-action=\"cancel\">Cancel</button>\n <button class=\"db-btn db-btn--primary\">Continue</button>\n </div>\n </div>\n</div>",
353
+ "skeleton": "db-alert-dialog#id > __overlay + __panel > __title + __desc + __actions",
350
354
  "notes": "Open: DAUB.openAlertDialog('id'). data-action=\"cancel\" auto-closes."
351
355
  },
352
356
  {
@@ -365,6 +369,7 @@
365
369
  ],
366
370
  "js": true,
367
371
  "html": "<div class=\"db-sheet db-sheet--right\" id=\"my-sheet\">\n <div class=\"db-sheet__overlay\"></div>\n <div class=\"db-sheet__panel\">\n <div class=\"db-sheet__header\">\n <span class=\"db-sheet__title\">Title</span>\n <button class=\"db-sheet__close\" aria-label=\"Close\">&times;</button>\n </div>\n <div class=\"db-sheet__body\">Content</div>\n </div>\n</div>",
372
+ "skeleton": "db-sheet.db-sheet--right#id > __overlay + __panel > __header + __body",
368
373
  "notes": "Sides: --right (default), --left, --top, --bottom. Open: DAUB.openSheet('id')."
369
374
  },
370
375
  {
@@ -381,6 +386,7 @@
381
386
  ],
382
387
  "js": true,
383
388
  "html": "<div class=\"db-drawer\" id=\"my-drawer\">\n <div class=\"db-drawer__overlay\"></div>\n <div class=\"db-drawer__panel\">\n <div class=\"db-drawer__handle\"></div>\n <div class=\"db-drawer__body\">Content</div>\n </div>\n</div>",
389
+ "skeleton": "db-drawer#id > __overlay + __panel > __handle + __body",
384
390
  "notes": "Mobile-friendly bottom panel. Open: DAUB.openDrawer('id')."
385
391
  },
386
392
  {
@@ -685,7 +691,8 @@
685
691
  ],
686
692
  "js": true,
687
693
  "html": "<div class=\"db-dropdown\">\n <button class=\"db-btn db-dropdown__trigger\">Options</button>\n <div class=\"db-dropdown__content\">\n <div class=\"db-dropdown__label\">Actions</div>\n <button class=\"db-dropdown__item\">Edit</button>\n <hr class=\"db-dropdown__separator\">\n <button class=\"db-dropdown__item\">Delete</button>\n </div>\n</div>",
688
- "notes": "JS auto-initializes toggle. Right-aligned: add db-dropdown__content--right."
694
+ "skeleton": "db-dropdown > __trigger + __content > __item + __separator + __label",
695
+ "notes": "JS auto-initializes toggle. Right-aligned: add db-dropdown__content--right. __menu is an alias for __content."
689
696
  },
690
697
  {
691
698
  "name": "Context Menu",
@@ -700,6 +707,7 @@
700
707
  ],
701
708
  "js": true,
702
709
  "html": "<div data-context-menu=\"my-ctx-menu\">Right-click here</div>\n<div class=\"db-context-menu\" id=\"my-ctx-menu\">\n <div class=\"db-context-menu__label\">Actions</div>\n <button class=\"db-context-menu__item\">Copy</button>\n <hr class=\"db-context-menu__separator\">\n <button class=\"db-context-menu__item\">Delete</button>\n</div>",
710
+ "skeleton": "data-context-menu='id' target + db-context-menu#id > __item + __separator + __label",
703
711
  "notes": "Triggered by data-context-menu attribute on right-click target."
704
712
  },
705
713
  {
@@ -721,6 +729,7 @@
721
729
  ],
722
730
  "js": true,
723
731
  "html": "<div class=\"db-command\" id=\"cmd\">\n <div class=\"db-command__overlay\"></div>\n <div class=\"db-command__panel\">\n <div class=\"db-command__input-wrap\">\n <input class=\"db-command__input\" placeholder=\"Search...\">\n </div>\n <div class=\"db-command__list\">\n <div class=\"db-command__group-label\">Navigation</div>\n <div class=\"db-command__item\">Home</div>\n </div>\n </div>\n</div>",
732
+ "skeleton": "db-command#id > __overlay + __panel > __input-wrap + __list",
724
733
  "notes": "Opens with Ctrl+K / Cmd+K. JS: DAUB.openCommand('id'), DAUB.closeCommand('id')."
725
734
  },
726
735
  {
package/daub.css CHANGED
@@ -230,6 +230,7 @@ body::before {
230
230
  /* Glass: floating — popovers, dropdowns, hover cards, toasts */
231
231
  [data-db-texture="glass"] .db-popover__content,
232
232
  [data-db-texture="glass"] .db-dropdown__content,
233
+ [data-db-texture="glass"] .db-dropdown__menu,
233
234
  [data-db-texture="glass"] .db-hover-card__content,
234
235
  [data-db-texture="glass"] .db-context-menu,
235
236
  [data-db-texture="glass"] .db-toast {
@@ -286,11 +287,11 @@ body::before {
286
287
 
287
288
  /* Per-element texture — applies grain/paper/metal/wood to physical surfaces
288
289
  Note: <input>, <textarea>, <select> are void/replaced elements — cannot have ::after.
289
- Texture on form fields comes through their wrapper (.db-field, .db-input-group, etc.) */
290
+ Texture on form fields comes through their wrappers (.db-input-group, .db-input-icon, etc.)
291
+ NOT .db-field — that wrapper includes labels and helper text which shouldn't have texture. */
290
292
  .db-card::after,
291
293
  .db-btn--primary::after,
292
294
  .db-btn--secondary::after,
293
- .db-field::after,
294
295
  .db-input-group::after,
295
296
  .db-input-icon::after,
296
297
  .db-search::after,
@@ -4194,7 +4195,8 @@ textarea.db-field__input {
4194
4195
  display: inline-block;
4195
4196
  }
4196
4197
 
4197
- .db-dropdown__content {
4198
+ .db-dropdown__content,
4199
+ .db-dropdown__menu {
4198
4200
  display: none;
4199
4201
  position: absolute;
4200
4202
  z-index: 1040;
@@ -4208,8 +4210,10 @@ textarea.db-field__input {
4208
4210
  box-shadow: var(--db-shadow-2);
4209
4211
  }
4210
4212
 
4211
- .db-dropdown--open .db-dropdown__content { display: block; }
4212
- .db-dropdown__content--right { left: auto; right: 0; }
4213
+ .db-dropdown--open .db-dropdown__content,
4214
+ .db-dropdown--open .db-dropdown__menu { display: block; }
4215
+ .db-dropdown__content--right,
4216
+ .db-dropdown__menu--right { left: auto; right: 0; }
4213
4217
 
4214
4218
  .db-dropdown__item {
4215
4219
  display: flex;
@@ -4294,7 +4298,7 @@ textarea.db-field__input {
4294
4298
  ------------------------------------------------------------ */
4295
4299
  .db-tooltip {
4296
4300
  position: relative;
4297
- display: inline-block;
4301
+ display: inline-flex;
4298
4302
  }
4299
4303
 
4300
4304
  .db-tooltip__content {
package/daub.js CHANGED
@@ -1210,6 +1210,8 @@
1210
1210
  drop._dbInit = true;
1211
1211
  var trigger = drop.querySelector('.db-dropdown__trigger');
1212
1212
  if (!trigger) return;
1213
+ var content = drop.querySelector('.db-dropdown__content') || drop.querySelector('.db-dropdown__menu');
1214
+ if (!content) return;
1213
1215
  trigger.addEventListener('click', function(e) {
1214
1216
  e.stopPropagation();
1215
1217
  var wasOpen = drop.classList.contains('db-dropdown--open');
@@ -1659,10 +1661,11 @@
1659
1661
  var isDev = host === 'localhost' || host === '127.0.0.1' || host === '[::1]' || document.documentElement.hasAttribute('data-db-debug');
1660
1662
  if (!isDev) return;
1661
1663
  var checks = [
1662
- ['.db-dropdown', '.db-dropdown__trigger', 'DAUB: .db-dropdown missing __trigger child'],
1664
+ ['.db-dropdown', '.db-dropdown__trigger', 'DAUB: .db-dropdown missing __trigger child. Add a button.db-dropdown__trigger.'],
1665
+ ['.db-dropdown', '.db-dropdown__content, .db-dropdown__menu', 'DAUB: .db-dropdown missing __content child. Add a div.db-dropdown__content with your menu items.'],
1663
1666
  ['.db-custom-select', '.db-custom-select__trigger', 'DAUB: .db-custom-select missing __trigger child'],
1664
1667
  ['.db-tabs', '.db-tabs__list', 'DAUB: .db-tabs missing __list child'],
1665
- ['.db-field', '.db-field__input', 'DAUB: .db-field missing __input child'],
1668
+ ['.db-field', '.db-field__input', 'DAUB: .db-field missing child with class "db-field__input". Add db-field__input to your input, textarea, select wrapper, or custom control element.'],
1666
1669
  ['.db-slider', '.db-slider__input', 'DAUB: .db-slider missing __input child'],
1667
1670
  ['.db-accordion', '.db-accordion__item', 'DAUB: .db-accordion has no __item children'],
1668
1671
  ['.db-checkbox', '.db-checkbox__input', 'DAUB: .db-checkbox missing __input child'],
@@ -1673,8 +1676,15 @@
1673
1676
  if (!el.querySelector(c[1])) console.warn(c[2], el);
1674
1677
  });
1675
1678
  });
1676
- root.querySelectorAll('.db-modal').forEach(function(el) {
1677
- if (!el.id) console.warn('DAUB: .db-modal missing id attribute', el);
1679
+ root.querySelectorAll('.db-modal-overlay').forEach(function(el) {
1680
+ if (!el.id) console.warn('DAUB: .db-modal-overlay missing id attribute — JS API needs an id to target this modal.', el);
1681
+ if (!el.hasAttribute('aria-hidden')) console.warn('DAUB: .db-modal-overlay should have aria-hidden="true" for accessibility.', el);
1682
+ });
1683
+ root.querySelectorAll('.db-tabs').forEach(function(tabs) {
1684
+ var tabCount = tabs.querySelectorAll('.db-tabs__tab').length;
1685
+ var panelCount = tabs.querySelectorAll('.db-tabs__panel').length;
1686
+ if (panelCount > 0 && tabCount !== panelCount)
1687
+ console.warn('DAUB: .db-tabs has ' + tabCount + ' tabs but ' + panelCount + ' panels — counts should match.', tabs);
1678
1688
  });
1679
1689
  }
1680
1690
 
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # DAUB UI — Considered Component Library for AI Agents
2
2
 
3
- > Version: 2.6.0
3
+ > Version: 2.7.0
4
4
  > URL: https://daub.dev
5
5
  > CSS: https://daub.dev/daub.css
6
6
  > JS: https://daub.dev/daub.js
@@ -20,8 +20,8 @@
20
20
 
21
21
  Alternative CDNs (npm package: daub-ui):
22
22
  ```html
23
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daub-ui@2.6.0/daub.css">
24
- <script src="https://cdn.jsdelivr.net/npm/daub-ui@2.6.0/daub.js"></script>
23
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daub-ui@latest/daub.css">
24
+ <script src="https://cdn.jsdelivr.net/npm/daub-ui@latest/daub.js"></script>
25
25
  ```
26
26
 
27
27
  Fonts: System font stacks by default. Optional Google Fonts:
@@ -80,7 +80,31 @@ Direct API: `DAUB.setTheme('ink')`, `DAUB.cycleTheme()`, `DAUB.getTheme()`
80
80
  Accent API: `DAUB.setAccent('#6B7C3E')`, `DAUB.resetAccent()`, `DAUB.getAccent()`
81
81
  Persisted in `localStorage` keys: `db-theme`, `db-scheme`, `db-accent`.
82
82
 
83
- ## Components (67)
83
+ ## Quick Reference Skeletons
84
+
85
+ Required HTML nesting for overlay and complex components. Use these as a starting template — each shows the minimum required structure.
86
+
87
+ | Component | Skeleton | JS API |
88
+ |-----------|----------|--------|
89
+ | Modal | `db-modal-overlay#id[aria-hidden] > db-modal > __header + __body + __footer` | `DAUB.openModal('id')` / `closeModal('id')` |
90
+ | Alert Dialog | `db-alert-dialog#id > __overlay + __panel > __title + __desc + __actions` | `DAUB.openAlertDialog('id')` |
91
+ | Sheet | `db-sheet.--right#id > __overlay + __panel > __header + __body` | `DAUB.openSheet('id')` |
92
+ | Drawer | `db-drawer#id > __overlay + __panel > __handle + __body` | `DAUB.openDrawer('id')` |
93
+ | Command Palette | `db-command#id > __overlay + __panel > __input-wrap + __list` | `DAUB.openCommand('id')` |
94
+ | Dropdown Menu | `db-dropdown > __trigger + __content > __item + __separator` | Auto-init on click |
95
+ | Context Menu | `[data-context-menu='id'] + db-context-menu#id > __item + __separator` | Auto-init on right-click |
96
+ | Tabs | `db-tabs > __list[role=tablist] > __tab + __panel` | Auto-init |
97
+ | Accordion | `db-accordion > __item > __trigger + __content` | Auto-init |
98
+ | Custom Select | `db-custom-select > __trigger + __dropdown > __option` | Auto-init |
99
+
100
+ **Notes:**
101
+ - `__` prefix means BEM child of the block (e.g., `__header` = `db-modal__header`)
102
+ - Overlay wrappers (modal-overlay, alert-dialog, sheet, drawer, command) need an `id` for JS targeting
103
+ - `db-modal-overlay` also needs `aria-hidden="true"` for accessibility
104
+ - `db-field__input` goes on wrapper elements — not just `<input>` tags
105
+ - Icons: DAUB pairs well with [Lucide](https://unpkg.com/lucide@latest) — all demos use Lucide icons
106
+
107
+ ## Components (76)
84
108
 
85
109
  ### 1. Button — `.db-btn`
86
110
  Variants: `db-btn--primary`, `db-btn--secondary`, `db-btn--ghost`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daub-ui",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Considered CSS component library — 76 components, 20 theme families, zero build step",
5
5
  "main": "daub.js",
6
6
  "style": "daub.css",