daub-ui 2.6.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 ADDED
@@ -0,0 +1,378 @@
1
+ # DAUB
2
+
3
+ **Considered CSS components for discerning interfaces.**
4
+
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)
7
+ [![Components](https://img.shields.io/badge/components-76-D4C4A8.svg)](https://daub.dev)
8
+
9
+ [Live Demo](https://daub.dev) | [Layout Demos](https://daub.dev/demo.html) | [AI Docs](https://daub.dev/llms.txt)
10
+
11
+ ---
12
+
13
+ ## What is DAUB?
14
+
15
+ A drop-in CSS + JS component library with a tactile, handcrafted aesthetic. 76 components, 20 theme families (each with light & dark modes), zero build step. Thoughtfully composed, no ceremony required.
16
+
17
+ ## Quick Start
18
+
19
+ ### CDN (recommended)
20
+
21
+ ```html
22
+ <link rel="stylesheet" href="https://daub.dev/daub.css">
23
+ <script src="https://daub.dev/daub.js"></script>
24
+ ```
25
+
26
+ Alternative CDNs (npm package: `daub-ui`):
27
+ ```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
+ ```
31
+
32
+ ### Download
33
+
34
+ ```bash
35
+ git clone https://github.com/sliday/daub.git
36
+ ```
37
+
38
+ ### Optional: Fonts & Icons
39
+
40
+ DAUB uses system font stacks by default. For richer typography:
41
+
42
+ ```html
43
+ <link href="https://fonts.googleapis.com/css2?family=Fraunces:wght@300..900&family=Source+Serif+4:wght@300..900&family=Cabin:wght@400;500;600;700&display=swap" rel="stylesheet">
44
+ <style>
45
+ :root {
46
+ --db-font-heading: 'Fraunces', Georgia, serif;
47
+ --db-font-body: 'Source Serif 4', Georgia, serif;
48
+ --db-font-ui: 'Cabin', system-ui, sans-serif;
49
+ }
50
+ </style>
51
+
52
+ <!-- Lucide Icons (used in demos, not required) -->
53
+ <script src="https://unpkg.com/lucide@latest"></script>
54
+ ```
55
+
56
+ ## Components (76)
57
+
58
+ ### Foundations
59
+ | Component | Class | Notes |
60
+ |-----------|-------|-------|
61
+ | Surface | `db-surface` | `--raised`, `--inset`, `--pressed` |
62
+ | Typography | `db-h1`–`db-h4` | `db-body`, `db-label`, `db-caption` |
63
+ | Prose | `db-prose` | `--sm`, `--lg`, `--xl`, `--2xl` |
64
+ | Elevation | `db-elevation-1` | `1`, `2`, `3` |
65
+ | Separator | `db-separator` | `--vertical`, `--dashed`, `__label` |
66
+ | Layout | `db-container` | `--wide`, `--narrow`, `db-flex`, `db-grid--2`–`--6`, `db-gap-*` |
67
+ | Responsive | `db-hide-mobile` | `db-show-mobile`, `db-hide-tablet`, `db-show-tablet`, etc. |
68
+ | Utilities | `db-sr-only` | `db-text-muted`, `db-rounded-*`, etc. |
69
+
70
+ ### Controls
71
+ | Component | Class | Notes |
72
+ |-----------|-------|-------|
73
+ | Button | `db-btn` | `--primary`, `--secondary`, `--ghost`, `--sm`, `--lg`, `--icon`, `--loading` |
74
+ | Button Group | `db-btn-group` | Groups buttons with connected borders |
75
+ | Text Field | `db-field` | `--error` |
76
+ | Input | `db-input` | `--sm`, `--lg`, `--error`, standalone |
77
+ | Input Group | `db-input-group` | Addons + inputs + buttons |
78
+ | Input Icon | `db-input-icon` | `--right`, icon prefix/suffix |
79
+ | Search | `db-search` | `__icon`, `__clear`, auto show/hide clear button |
80
+ | Textarea | `db-textarea` | `--error`, standalone |
81
+ | Checkbox | `db-checkbox` | |
82
+ | Radio | `db-radio` | `db-radio-group` |
83
+ | Switch | `db-switch` | `aria-checked` |
84
+ | Slider | `db-slider` | |
85
+ | Toggle | `db-toggle` | `--sm`, `aria-pressed` |
86
+ | Toggle Group | `db-toggle-group` | Single/multi select |
87
+ | Native Select | `db-select` | `__input` with chevron |
88
+ | Custom Select | `db-custom-select` | Search, selection, combobox |
89
+ | Kbd | `db-kbd` | `--sm` |
90
+ | Label | `db-label` | `--required`, `--optional` |
91
+ | Spinner | `db-spinner` | `--sm`, `--lg`, `--xl` |
92
+ | Input OTP | `db-otp` | `__input`, `__separator` |
93
+
94
+ ### Navigation
95
+ | Component | Class | Notes |
96
+ |-----------|-------|-------|
97
+ | Tabs | `db-tabs` | |
98
+ | Breadcrumbs | `db-breadcrumbs` | |
99
+ | Pagination | `db-pagination` | |
100
+ | Stepper | `db-stepper` | `--completed`, `--active`, `--pending` |
101
+ | Nav Menu | `db-nav-menu` | `__item`, `--active` |
102
+ | Navbar | `db-navbar` | `__brand`, `__nav`, `__actions`, `__toggle`, sticky mobile hamburger |
103
+ | Menubar | `db-menubar` | `__item`, `__dropdown` |
104
+ | Sidebar | `db-sidebar` | `__item`, `--active`, `--collapsed`, `__toggle` |
105
+ | Bottom Nav | `db-bottom-nav` | `__item`, `--active`, `__badge`, `--always` |
106
+
107
+ ### Data Display
108
+ | Component | Class | Notes |
109
+ |-----------|-------|-------|
110
+ | Card | `db-card` | `--media` for edge-to-edge images |
111
+ | Table | `db-table` | `data-db-sort` |
112
+ | Data Table | `db-data-table` | Sortable, selectable rows |
113
+ | List | `db-list` | |
114
+ | Badge | `db-badge` | `--new`, `--updated`, `--warning`, `--error` |
115
+ | Avatar | `db-avatar` | `--sm`, `--md`, `--lg` |
116
+ | Avatar Group | `db-avatar-group` | Overlapping stack + `__overflow` counter |
117
+ | Calendar | `db-calendar` | Day selection, today highlight |
118
+ | Chart | `db-chart` | CSS-only bar chart |
119
+ | Carousel | `db-carousel` | `__track`, `__slide`, `__dots` |
120
+ | Aspect Ratio | `db-aspect` | `--16-9`, `--4-3`, `--1-1`, `--21-9` |
121
+ | Chip | `db-chip` | `--red`, `--green`, `--blue`, `--purple`, `--amber`, `--pink`, `--active`, `__close`, `data-db-chip-toggle` |
122
+ | Scroll Area | `db-scroll-area` | `--horizontal`, `--vertical` |
123
+
124
+ ### Feedback
125
+ | Component | Class | Notes |
126
+ |-----------|-------|-------|
127
+ | Toast | JS only | `DAUB.toast({ type, title, message })` |
128
+ | Alert | `db-alert` | `--info`, `--warning`, `--error`, `--success` |
129
+ | Progress | `db-progress` | `--indeterminate` |
130
+ | Skeleton | `db-skeleton` | `--text`, `--heading`, `--avatar`, `--btn` |
131
+ | Empty State | `db-empty` | |
132
+ | Tooltip | `db-tooltip` | `--top`, `--bottom`, `--left`, `--right` |
133
+
134
+ ### Overlays
135
+ | Component | Class | Notes |
136
+ |-----------|-------|-------|
137
+ | Modal | `db-modal` | `DAUB.openModal()`, `DAUB.closeModal()` |
138
+ | Alert Dialog | `db-alert-dialog` | `DAUB.openAlertDialog()` |
139
+ | Sheet | `db-sheet` | `--right`, `--left`, `--top`, `--bottom` |
140
+ | Drawer | `db-drawer` | Mobile-friendly bottom panel |
141
+ | Popover | `db-popover` | `--top`, `--bottom`, `--left`, `--right` |
142
+ | Hover Card | `db-hover-card` | CSS hover trigger |
143
+ | Dropdown Menu | `db-dropdown` | `__item`, `__separator`, `__label` |
144
+ | Context Menu | `db-context-menu` | Right-click, `data-context-menu` |
145
+ | Command Palette | `db-command` | `DAUB.openCommand()`, Ctrl+K |
146
+
147
+ ### Layout & Utility
148
+ | Component | Class | Notes |
149
+ |-----------|-------|-------|
150
+ | Accordion | `db-accordion` | Single/multi mode via `data-multi` |
151
+ | Collapsible | `db-collapsible` | Progressive disclosure |
152
+ | Resizable | `db-resizable` | `__handle--right`, `--bottom`, `--corner` |
153
+ | Date Picker | `db-date-picker` | Wraps Calendar in popover |
154
+ | Theme Switcher | `db-theme-switcher` | 20 families + scheme switcher |
155
+
156
+ ## Themes
157
+
158
+ 20 theme families in 4 categories, each with light and dark modes (40 variants total):
159
+
160
+ ### Originals
161
+ | Family | Light | Dark | Character |
162
+ |--------|-------|------|-----------|
163
+ | Default | `light` | `dark` | Warm cream / deep charcoal |
164
+ | Grunge | `grunge-light` | `grunge-dark` | Typewriter / ink-stained |
165
+ | Solarized | `solarized` | `solarized-dark` | Warm tinted / dusky amber |
166
+ | Ink | `ink-light` | `ink` | Cool editorial / navy silver |
167
+ | Ember | `ember-light` | `ember` | Sunlit pottery / copper glow |
168
+ | Bone | `bone` | `bone-dark` | Stark white / grayscale brutalism |
169
+
170
+ ### Classics
171
+ | Family | Light | Dark | Character |
172
+ |--------|-------|------|-----------|
173
+ | Dracula | `dracula-light` | `dracula` | Alucard warmth / vampire purple |
174
+ | Nord | `nord-light` | `nord` | Snow storm / arctic frost |
175
+ | One Dark | `one-dark-light` | `one-dark` | Soft atom / midnight code |
176
+ | Monokai | `monokai-light` | `monokai` | Warm latte / neon noir |
177
+ | Gruvbox | `gruvbox-light` | `gruvbox` | Retro cream / earthy dark |
178
+
179
+ ### Modern
180
+ | Family | Light | Dark | Character |
181
+ |--------|-------|------|-----------|
182
+ | Night Owl | `night-owl-light` | `night-owl` | Soft dawn / deep twilight |
183
+ | GitHub | `github` | `github-dark` | Clean primer / dimmed slate |
184
+ | Catppuccin | `catppuccin` | `catppuccin-dark` | Latte pastel / mocha warmth |
185
+ | Tokyo Night | `tokyo-night-light` | `tokyo-night` | Storm light / city neon |
186
+ | Material | `material-light` | `material` | Lighter paper / palenight haze |
187
+
188
+ ### Trending
189
+ | Family | Light | Dark | Character |
190
+ |--------|-------|------|-----------|
191
+ | Synthwave | `synthwave-light` | `synthwave` | Warm retro / neon purple |
192
+ | Shades of Purple | `shades-of-purple-light` | `shades-of-purple` | Soft lavender / deep violet |
193
+ | Ayu | `ayu` | `ayu-dark` | Warm light / mirage dark |
194
+ | Horizon | `horizon-light` | `horizon` | Soft rose / warm dusk |
195
+
196
+ ### Switching themes
197
+
198
+ ```html
199
+ <html data-theme="dark">
200
+ ```
201
+
202
+ ```js
203
+ // Family-based (recommended)
204
+ DAUB.setFamily('ink'); // sets ink-light or ink depending on scheme
205
+ DAUB.setScheme('dark'); // switches current family to dark mode
206
+ DAUB.cycleTheme(); // cycles through 20 families, preserving mode
207
+
208
+ // Direct theme (backward compatible)
209
+ DAUB.setTheme('ink'); // sets exact theme variant
210
+ DAUB.getTheme(); // returns current theme name
211
+
212
+ // Accent color
213
+ DAUB.setAccent('#6B7C3E'); // olive accent, overrides terracotta
214
+ DAUB.resetAccent(); // restore theme default
215
+ ```
216
+
217
+ Theme, scheme, and accent persist across page loads via `localStorage`.
218
+
219
+ ### FOUC Prevention
220
+
221
+ ```html
222
+ <script>
223
+ (function(){try{var t=localStorage.getItem('db-theme');if(t)document.documentElement.setAttribute('data-theme',t);var s=localStorage.getItem('db-scheme');if(s)document.documentElement.setAttribute('data-scheme',s);var a=localStorage.getItem('db-accent');if(a)document.documentElement.style.setProperty('--db-terracotta',a)}catch(e){}})();
224
+ </script>
225
+ ```
226
+
227
+ ## Prose Typography
228
+
229
+ The `.db-prose` class provides considered typographic defaults for long-form content:
230
+
231
+ ```html
232
+ <div class="db-prose">
233
+ <h2>Title</h2>
234
+ <p>Body text with comfortable 1.75 line-height and 65ch max-width.</p>
235
+ </div>
236
+ ```
237
+
238
+ Scale variants: `db-prose--sm`, `db-prose--lg`, `db-prose--xl`, `db-prose--2xl`.
239
+
240
+ ## Customization
241
+
242
+ Override CSS custom properties:
243
+
244
+ ```css
245
+ :root {
246
+ --db-terracotta: #E07A5F;
247
+ --db-cream: #FAF8F0;
248
+ --db-font-heading: 'Your Font', serif;
249
+ }
250
+ ```
251
+
252
+ Key variables: `--db-cream`, `--db-sand`, `--db-terracotta`, `--db-clay`, `--db-charcoal`, `--db-ink`, `--db-white`.
253
+
254
+ Semantic tokens (theme-aware aliases): `--db-color-bg`, `--db-color-surface`, `--db-color-text`, `--db-color-text-secondary`, `--db-color-text-muted`, `--db-color-border`, `--db-color-accent`, `--db-color-success`, `--db-color-warning`, `--db-color-error`.
255
+
256
+ ## Accessibility
257
+
258
+ - WCAG AA colour contrast across all 40 theme variants
259
+ - `aria-*` attributes on all interactive components
260
+ - Focus-visible outlines (keyboard navigation)
261
+ - Modal/Dialog: focus trapping, Escape to close
262
+ - Tabs: arrow key navigation
263
+ - Screen reader utility: `db-sr-only`
264
+ - Reduced motion support via `prefers-reduced-motion`
265
+
266
+ ## AI Integration
267
+
268
+ DAUB speaks both human and machine:
269
+
270
+ - **`/llms.txt`** — Plain-text component reference for LLMs ([spec](https://llmstxt.org))
271
+ - **`/components.json`** — Machine-readable structured component reference (76 components with HTML examples)
272
+ - **`/daub.d.ts`** — TypeScript declarations for `window.DAUB` API
273
+ - **`/.well-known/ai-plugin.json`** — AI plugin manifest
274
+ - **`SKILL.md`** — Claude Code skill for DAUB development
275
+
276
+ Point your AI at `https://daub.dev/llms.txt` for complete component docs with HTML snippets, or fetch `https://daub.dev/components.json` for structured data.
277
+
278
+ ## Use with AI
279
+
280
+ Drop these prompts into Claude, ChatGPT, Cursor, or any AI assistant. Each produces a complete, working HTML page. Add "Fetch docs from daub.dev/llms.txt first" for best results.
281
+
282
+ | Prompt | What You Get |
283
+ |--------|-------------|
284
+ | "Build an analytics dashboard using DAUB with sidebar, stat cards, sortable data table, and bar chart. Dark theme." | Full dashboard with `db-sidebar`, `db-card`, `db-data-table`, `db-chart` |
285
+ | "Create a user settings page with DAUB. Profile section with avatar, notification switches, danger zone with alert dialog. Nord theme." | Settings form with `db-field`, `db-switch`, `db-alert-dialog` |
286
+ | "Build a responsive product catalog with DAUB. Media cards in a grid, chip filters, pagination, navbar with search. Catppuccin theme." | E-commerce layout with `db-card--media`, `db-chip`, `db-pagination`, `db-search` |
287
+ | "Create a Kanban task board using DAUB. Three columns, priority badges, assignee avatars, command palette. Tokyo Night theme." | Project board with `db-grid--3`, `db-badge`, `db-avatar`, `db-command` |
288
+ | "Build a blog reading page with DAUB. Prose typography, breadcrumbs, author card, table of contents sidebar. GitHub theme." | Article layout with `db-prose`, `db-breadcrumbs`, `db-nav-menu` |
289
+ | "Create a multi-step onboarding form with DAUB's stepper. Account info, preferences, confirmation. Ember theme." | Wizard flow with `db-stepper`, `db-field`, `db-switch`, `db-card` |
290
+
291
+ ### Minimal Dashboard
292
+
293
+ ```html
294
+ <!DOCTYPE html>
295
+ <html data-theme="light">
296
+ <head>
297
+ <meta charset="utf-8">
298
+ <meta name="viewport" content="width=device-width, initial-scale=1">
299
+ <title>Dashboard</title>
300
+ <link rel="stylesheet" href="https://daub.dev/daub.css">
301
+ </head>
302
+ <body>
303
+ <nav class="db-navbar">
304
+ <a class="db-navbar__brand" href="/">Acme</a>
305
+ <div class="db-navbar__spacer"></div>
306
+ <div class="db-navbar__actions">
307
+ <div class="db-avatar db-avatar--sm">JD</div>
308
+ </div>
309
+ </nav>
310
+ <main class="db-container" style="padding:var(--db-space-6) var(--db-space-4)">
311
+ <div class="db-grid db-grid--3 db-gap-4 db-mb-5">
312
+ <div class="db-card" style="padding:var(--db-space-4)">
313
+ <div class="db-stat">
314
+ <span class="db-stat__label">Revenue</span>
315
+ <span class="db-stat__value">$12,450</span>
316
+ <span class="db-stat__change db-stat__change--up">↑ 12.5%</span>
317
+ </div>
318
+ </div>
319
+ <div class="db-card" style="padding:var(--db-space-4)">
320
+ <div class="db-stat">
321
+ <span class="db-stat__label">Users</span>
322
+ <span class="db-stat__value">1,284</span>
323
+ <span class="db-stat__change db-stat__change--up">↑ 4.3%</span>
324
+ </div>
325
+ </div>
326
+ <div class="db-card" style="padding:var(--db-space-4)">
327
+ <div class="db-stat">
328
+ <span class="db-stat__label">Orders</span>
329
+ <span class="db-stat__value">342</span>
330
+ <span class="db-stat__change db-stat__change--down">↓ 2.1%</span>
331
+ </div>
332
+ </div>
333
+ </div>
334
+ <div class="db-card">
335
+ <div class="db-card__header">
336
+ <h3 class="db-card__title">Recent Orders</h3>
337
+ <span class="db-badge">Today</span>
338
+ </div>
339
+ <table class="db-table">
340
+ <thead><tr><th>Customer</th><th class="db-numeric">Amount</th><th>Status</th></tr></thead>
341
+ <tbody>
342
+ <tr><td>Alice Park</td><td class="db-numeric">$120</td><td><span class="db-badge db-badge--new">Paid</span></td></tr>
343
+ <tr><td>Bob Chen</td><td class="db-numeric">$85</td><td><span class="db-badge db-badge--warning">Pending</span></td></tr>
344
+ <tr><td>Carol Davis</td><td class="db-numeric">$240</td><td><span class="db-badge db-badge--new">Paid</span></td></tr>
345
+ </tbody>
346
+ </table>
347
+ </div>
348
+ </main>
349
+ <div class="db-theme-switcher"></div>
350
+ <script src="https://daub.dev/daub.js"></script>
351
+ </body>
352
+ </html>
353
+ ```
354
+
355
+ Save as `.html`, open in a browser. No build step.
356
+
357
+ ## Browser Support
358
+
359
+ - Chrome/Edge 90+
360
+ - Firefox 90+
361
+ - Safari 15+
362
+ - Mobile Safari, Chrome for Android
363
+
364
+ No polyfills needed.
365
+
366
+ ## Changelog
367
+
368
+ See [CHANGELOG.md](CHANGELOG.md) for the full release history.
369
+
370
+ **Latest: v2.6.0** — Dashboard primitives, table utilities, getColor helper. 76 components, 20 theme families.
371
+
372
+ ## License
373
+
374
+ MIT
375
+
376
+ ---
377
+
378
+ Made with consideration by [Sliday](https://github.com/sliday).