@pure-ds/core 0.4.35 → 0.4.37

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.
@@ -0,0 +1,626 @@
1
+ # Getting Started with Pure Design System
2
+
3
+ From zero to hero with PDS.
4
+
5
+ ## 1. Installation (or not)
6
+
7
+ ### Option A: NPM Package (Recommended)
8
+
9
+ ```bash
10
+ npm install @pure-ds/core
11
+ ```
12
+
13
+ **What happens during install:**
14
+
15
+ PDS automatically sets up your project:
16
+ - ✅ Creates `pds.config.js` with commented examples (if it doesn't exist)
17
+ - ✅ Exports static assets to your web root (components, icons, styles)
18
+ - ✅ Copies AI/Copilot instructions to `.github/copilot-instructions.md`
19
+ - ✅ Adds helper scripts to your `package.json` (`pds:export`, `pds:build-icons`)
20
+
21
+ The generated `pds.config.js` includes:
22
+
23
+ ```javascript
24
+ // pds.config.js (auto-generated)
25
+ export const config = {
26
+ mode: "live",
27
+ preset: "default",
28
+
29
+ // Uncomment and customize as needed:
30
+ // design: { colors: { primary: '#007acc' } },
31
+ // enhancers: [ /* custom enhancements */ ],
32
+ // autoDefine: { predefine: ['pds-icon'] }
33
+ }
34
+ ```
35
+
36
+ Then initialize in your app:
37
+
38
+ ```javascript
39
+ import { PDS } from '@pure-ds/core';
40
+ import { config } from "./pds.config.js"; // project root
41
+
42
+ await PDS.start(config); // That's it! Start writing semantic HTML.
43
+ ```
44
+
45
+ **Manual config generation:**
46
+
47
+ ```bash
48
+ # Create or regenerate config with examples
49
+ npx pds-init-config
50
+
51
+ # Update AI assistant instructions
52
+ npx pds-setup-copilot
53
+ ```
54
+
55
+ ---
56
+
57
+ ## 🤖 AI Assistant Integration (GitHub Copilot, Cursor, etc.)
58
+
59
+ **PDS includes comprehensive LLM instructions that teach AI assistants to use PDS patterns correctly.**
60
+
61
+ During installation, instructions are automatically copied to:
62
+ - `.github/copilot-instructions.md` (GitHub Copilot)
63
+ - `.cursorrules` (Cursor AI)
64
+
65
+ These instructions teach your AI to:
66
+ - ✅ Reference actual source files (`custom-elements.json`, `pds.css-data.json`, `pds-ontology.js`) instead of guessing
67
+ - ✅ Use PDS primitives (`.card`, `.btn-primary`, etc.) instead of creating custom CSS
68
+ - ✅ Apply progressive enhancements (`data-dropdown`, `data-toggle`) correctly
69
+ - ✅ Use web components only when necessary (`<pds-tabstrip>`, `<pds-form>`)
70
+ - ✅ Follow PDS best practices for forms, toasts, dialogs, and more
71
+
72
+ **To manually install or update:**
73
+
74
+ ```bash
75
+ npx pds-setup-copilot
76
+
77
+ # Force overwrite existing config
78
+ npx pds-init-config --force
79
+ ```
80
+
81
+ ### Option B: CDN (Zero Install)
82
+
83
+ Perfect for quick prototypes and learning:
84
+
85
+ ```html
86
+ <!DOCTYPE html>
87
+ <html lang="en">
88
+ <head>
89
+ <meta charset="UTF-8">
90
+ <title>My PDS App</title>
91
+ <script type="module" defer>
92
+ import { PDS } from "https://unpkg.com/pure-ds@latest/public/assets/js/pds.js";
93
+
94
+ await PDS.start({
95
+ mode: "live",
96
+ preset: "social-feed"
97
+ });
98
+ </script>
99
+ </head>
100
+ <body class="container">
101
+ [...]
102
+ </body>
103
+ </html>
104
+ ```
105
+
106
+ > See the [**PDS CodePen Collection**](https://codepen.io/collection/rBjkOy)
107
+ > These live examples let you see PDS in action and fork them for your own experiments.
108
+
109
+ ---
110
+
111
+ ### Power Through Composition
112
+
113
+ PDS gives you high-level primitives that compose naturally. No atomic utility classes to memorize—just semantic HTML with meaningful class names:
114
+
115
+ ```html
116
+ <!-- A complete card with surface treatment -->
117
+ <article class="card surface-elevated">
118
+ <header>
119
+ <h3>Welcome to PDS</h3>
120
+ <p class="text-muted">The browser is the framework</p>
121
+ </header>
122
+ <p>Write semantic HTML, get beautiful results.</p>
123
+ <footer class="flex gap-sm justify-end">
124
+ <button class="btn-secondary">Learn More</button>
125
+ <button class="btn-primary">Get Started</button>
126
+ </footer>
127
+ </article>
128
+ ```
129
+
130
+ **What's happening here:**
131
+ - `article.card` → semantic card primitive with proper spacing and borders
132
+ - `.surface-elevated` → contextual surface with shadow and background
133
+ - `header` with `h3` + `.text-muted` → automatic title/subtitle hierarchy
134
+ - `footer.flex.gap-sm.justify-end` → action area with button alignment
135
+
136
+ Each class represents a **design decision**, not a CSS property. That's the PDS difference.
137
+
138
+ ---
139
+
140
+ ## 2. Understanding pds.config.js
141
+
142
+ The heart of PDS is a simple JavaScript configuration file:
143
+
144
+ ```javascript
145
+ // pds.config.js
146
+ export const config = {
147
+ // Runtime mode: 'live' generates CSS at runtime, 'static' uses pre-built files
148
+ mode: "live",
149
+
150
+ // Start with a preset (optional)
151
+ preset: "default", // ocean-breeze, midnight-steel, sunset-vibes...
152
+
153
+ // Design tokens - override any preset values
154
+ design: {
155
+ colors: {
156
+ primary: '#007acc',
157
+ secondary: '#5c2d91'
158
+ },
159
+ typography: {
160
+ baseFontSize: 16,
161
+ fontScale: 1.25,
162
+ fontFamilyHeadings: 'Inter, sans-serif',
163
+ fontFamilyBody: 'Inter, sans-serif'
164
+ },
165
+ spatialRhythm: {
166
+ baseUnit: 8,
167
+ scaleRatio: 1.5
168
+ }
169
+ },
170
+
171
+ // Web Component auto-loading
172
+ autoDefine: {
173
+ predefine: ["pds-icon", "pds-drawer", "pds-toaster"]
174
+ },
175
+
176
+ // Custom progressive enhancements (optional)
177
+ enhancers: [
178
+ {
179
+ selector: '[data-tooltip]',
180
+ description: 'Adds tooltip on hover',
181
+ run: (element) => { /* enhancement logic */ }
182
+ }
183
+ ],
184
+
185
+ // Logging callback (optional)
186
+ log(level, message, ...data) {
187
+ console[level](message, ...data);
188
+ }
189
+ };
190
+ ```
191
+
192
+ ### Available Presets
193
+
194
+ ```javascript
195
+ Object.keys(PDS.presets);
196
+ // ['default', 'ocean-breeze', 'midnight-steel', 'sunset-vibes',
197
+ // 'forest-calm', 'lavender-dream', 'coral-energy', 'arctic-frost',
198
+ // 'golden-hour', 'neon-city', 'travel-market', 'mobility-app']
199
+ ```
200
+
201
+ ### Live vs Static Mode
202
+
203
+ | Feature | Live Mode | Static Mode |
204
+ |---------|-----------|-------------|
205
+ | CSS Generation | Runtime (in browser) | Build time |
206
+ | Config changes | Instant preview | Requires rebuild |
207
+ | Best for | Development, configurators | Production |
208
+ | `PDS.compiled` | Full access | Not available |
209
+
210
+ ---
211
+
212
+ ## 3. Running a Local Storybook
213
+
214
+ Want to explore all PDS features interactively? Set up the reference Storybook:
215
+
216
+ ### Install the Storybook Package
217
+
218
+ ```bash
219
+ npm install @pure-ds/storybook
220
+ ```
221
+
222
+ ### Integration into Your Project
223
+
224
+ ```bash
225
+ # Run integration from your project root
226
+ npx pds-storybook
227
+
228
+ # Start your Storybook
229
+ npm run storybook
230
+ ```
231
+
232
+ **What happens:**
233
+ - ✅ Validates your environment
234
+ - ✅ Exports PDS assets to `public/assets/pds/`
235
+ - ✅ Copies stories to `.storybook/pds-stories/`
236
+ - ✅ Patches `.storybook/preview.js` to initialize PDS
237
+
238
+ ### Storybook Features
239
+
240
+ Once running, you'll find:
241
+
242
+ - **🎨 Configurator** - Click the circle icon in the toolbar to open a live configuration panel
243
+ - **🔍 Quick Search** - Query tokens and components with natural language
244
+ - **📚 Stories** organized by design system standards:
245
+ - **Foundations** - Colors, typography, spacing, icons
246
+ - **Primitives** - Buttons, forms, cards, badges, alerts
247
+ - **Components** - Web Components (`<pds-*>`)
248
+ - **Patterns** - Layout utilities, border effects
249
+ - **Enhancements** - Progressive HTML enhancements
250
+
251
+ ---
252
+
253
+ ## 4. Using PDS (Pure Web Manifesto in Practice)
254
+
255
+ ### Semantic HTML First
256
+
257
+ Just write HTML. PDS makes it look right:
258
+
259
+ ```html
260
+ <!-- Card with semantic markup -->
261
+ <article class="card">
262
+ <header>
263
+ <h3>Card Title</h3>
264
+ </header>
265
+ <p>Content that speaks for itself.</p>
266
+ <footer>
267
+ <button class="btn-primary">Action</button>
268
+ </footer>
269
+ </article>
270
+
271
+ <!-- Buttons - no component imports needed -->
272
+ <button class="btn-primary">Primary</button>
273
+ <button class="btn-secondary">Secondary</button>
274
+ <button class="btn-outline">Outline</button>
275
+
276
+ <!-- Alerts with semantic meaning -->
277
+ <div class="alert alert-success">Operation completed!</div>
278
+ <div class="alert alert-warning">Please review before continuing.</div>
279
+ ```
280
+
281
+ ### Layout Utilities (Sparingly)
282
+
283
+ PDS provides a small set of layout utilities for composition:
284
+
285
+ ```html
286
+ <!-- Flex layout -->
287
+ <div class="flex gap-md items-center">
288
+ <pds-icon icon="user"></pds-icon>
289
+ <span>Profile</span>
290
+ </div>
291
+
292
+ <!-- Stack layout (vertical) -->
293
+ <section class="stack-lg">
294
+ <h2>Section Title</h2>
295
+ <p>First paragraph.</p>
296
+ <p>Second paragraph.</p>
297
+ </section>
298
+
299
+ <!-- Grid -->
300
+ <div class="grid grid-cols-3 gap-md">
301
+ <div class="card">Item 1</div>
302
+ <div class="card">Item 2</div>
303
+ <div class="card">Item 3</div>
304
+ </div>
305
+ ```
306
+
307
+ ### Using CSS Tokens
308
+
309
+ All design values are CSS custom properties:
310
+
311
+ ```css
312
+ /* In your CSS */
313
+ .my-component {
314
+ background: var(--surface-bg);
315
+ color: var(--surface-text);
316
+ padding: var(--spacing-4);
317
+ border-radius: var(--radius-md);
318
+ box-shadow: var(--shadow-md);
319
+ }
320
+
321
+ .highlight {
322
+ color: var(--color-primary-600);
323
+ border-color: var(--color-primary-300);
324
+ }
325
+ ```
326
+
327
+ ### Using Web Components
328
+
329
+ PDS components auto-load when used:
330
+
331
+ ```html
332
+ <!-- Icons from sprite -->
333
+ <pds-icon icon="heart"></pds-icon>
334
+ <pds-icon icon="star" size="lg"></pds-icon>
335
+
336
+ <!-- Drawer panel -->
337
+ <pds-drawer id="menu" position="left">
338
+ <h2 slot="header">Menu</h2>
339
+ <nav>...</nav>
340
+ </pds-drawer>
341
+ <button onclick="document.getElementById('menu').open()">Open Menu</button>
342
+
343
+ <!-- Tabs -->
344
+ <pds-tabstrip>
345
+ <pds-tabpanel label="Overview">
346
+ <p>Overview content</p>
347
+ </pds-tabpanel>
348
+ <pds-tabpanel label="Details">
349
+ <p>Details content</p>
350
+ </pds-tabpanel>
351
+ </pds-tabstrip>
352
+
353
+ <!-- Toast notifications (auto-created, no manual setup needed) -->
354
+ <script>
355
+ PDS.toast("Saved successfully!", { type: "success" });
356
+ </script>
357
+ ```
358
+
359
+ ---
360
+
361
+ ## 5. Progressive Enhancements
362
+
363
+ Enhancements add behavior to semantic HTML without requiring JavaScript frameworks.
364
+
365
+ ### Built-in Enhancements
366
+
367
+ **Dropdown menus** – `<nav data-dropdown>`
368
+ ```html
369
+ <nav data-dropdown>
370
+ <button>Menu</button>
371
+ <menu>
372
+ <li><a href="#home">Home</a></li>
373
+ <li><a href="#about">About</a></li>
374
+ </menu>
375
+ </nav>
376
+ ```
377
+
378
+ **Toggle switches** – `<label data-toggle>`
379
+ ```html
380
+ <label data-toggle>
381
+ <span data-label>Enable notifications</span>
382
+ <input type="checkbox">
383
+ </label>
384
+ ```
385
+
386
+ **Required field indicators** – automatic on `[required]`
387
+ ```html
388
+ <label>
389
+ <span>Email</span>
390
+ <input type="email" required>
391
+ </label>
392
+ <!-- Asterisk added automatically! -->
393
+ ```
394
+
395
+ **Range sliders** – enhanced `<input type="range">`
396
+ ```html
397
+ <label class="range-output">
398
+ <span>Volume</span>
399
+ <input type="range" min="0" max="100" value="50">
400
+ </label>
401
+ <!-- Value display added automatically! -->
402
+ ```
403
+
404
+ ### Creating Custom Enhancers
405
+
406
+ Add your own enhancements in `pds.config.js`:
407
+
408
+ ```javascript
409
+ export const config = {
410
+ enhancers: [
411
+ {
412
+ selector: '[data-copy]',
413
+ description: 'Copy text to clipboard on click',
414
+ run: (element) => {
415
+ element.addEventListener('click', () => {
416
+ navigator.clipboard.writeText(element.dataset.copy);
417
+ PDS.toast('Copied!', { type: 'success' });
418
+ });
419
+ }
420
+ },
421
+ {
422
+ selector: '[data-animate-in]',
423
+ description: 'Animate elements as they enter viewport',
424
+ run: (element) => {
425
+ const observer = new IntersectionObserver((entries) => {
426
+ entries.forEach(entry => {
427
+ if (entry.isIntersecting) {
428
+ element.classList.add('animated');
429
+ observer.unobserve(element);
430
+ }
431
+ });
432
+ });
433
+ observer.observe(element);
434
+ }
435
+ }
436
+ ]
437
+ };
438
+ ```
439
+
440
+ ### Testing Enhancements
441
+
442
+ 1. Add your enhancer to `pds.config.js`
443
+ 2. Restart PDS (or call `PDS.start()` again)
444
+ 3. Add matching HTML to your page
445
+ 4. Check the browser console for PDS logs
446
+ 5. Verify the enhancement runs on matching elements
447
+
448
+ ---
449
+
450
+ ## 6. Auto-Defining Your Own Web Components
451
+
452
+ The `autoDefine` system can load your custom components alongside PDS components.
453
+
454
+ ### Configure Custom Mappings
455
+
456
+ ```javascript
457
+ export const config = {
458
+ autoDefine: {
459
+ baseURL: '/assets/pds/components/',
460
+
461
+ // Eagerly load these at startup
462
+ predefine: ['pds-icon', 'my-header'],
463
+
464
+ // Map custom tags to files
465
+ mapper: (tag) => {
466
+ // Your custom components
467
+ if (tag.startsWith('my-')) {
468
+ return `/components/${tag}.js`;
469
+ }
470
+ // Return nothing to use PDS default mapping for pds-* tags
471
+ }
472
+ }
473
+ };
474
+ ```
475
+
476
+ ### Create Your Component
477
+
478
+ ```javascript
479
+ // /components/my-header.js
480
+ import { html, css, LitElement } from '#pds/lit';
481
+
482
+ class MyHeader extends LitElement {
483
+ static styles = css`
484
+ :host {
485
+ display: block;
486
+ }
487
+ `;
488
+
489
+ async connectedCallback() {
490
+ super.connectedCallback();
491
+ // Adopt PDS styles into Shadow DOM
492
+ await PDS.adoptPrimitives(this.shadowRoot);
493
+ }
494
+
495
+ render() {
496
+ return html`
497
+ <header class="surface-elevated">
498
+ <nav class="flex gap-md items-center">
499
+ <slot name="logo"></slot>
500
+ <slot></slot>
501
+ </nav>
502
+ </header>
503
+ `;
504
+ }
505
+ }
506
+
507
+ customElements.define('my-header', MyHeader);
508
+ ```
509
+
510
+ ### Use in HTML
511
+
512
+ ```html
513
+ <my-header>
514
+ <img slot="logo" src="logo.svg" alt="Logo">
515
+ <a href="/">Home</a>
516
+ <a href="/about">About</a>
517
+ </my-header>
518
+ ```
519
+
520
+ The component auto-loads when the tag is encountered in the DOM!
521
+
522
+ ---
523
+
524
+ ## 7. Working with PDS in the Console
525
+
526
+ PDS exposes a rich API for debugging and exploration in DevTools.
527
+
528
+ ### Open DevTools and Try:
529
+
530
+ ```javascript
531
+ // Check PDS is loaded
532
+ PDS
533
+
534
+ // View current configuration
535
+ PDS.currentConfig
536
+
537
+ // Access compiled tokens (live mode)
538
+ PDS.compiled.tokens.colors.primary
539
+ PDS.compiled.tokens.spacing
540
+
541
+ // List available presets
542
+ Object.keys(PDS.presets)
543
+
544
+ // Get a specific preset config
545
+ PDS.presets['ocean-breeze']
546
+
547
+ // Query the design system with natural language
548
+ await PDS.query("button hover color")
549
+ await PDS.query("what spacing values are available?")
550
+ await PDS.query("how do I create a card?")
551
+
552
+ // Theme management
553
+ PDS.theme // Get current theme
554
+ PDS.theme = 'dark' // Set theme
555
+ PDS.theme = 'system' // Follow OS preference
556
+
557
+ // Show a toast notification
558
+ PDS.toast("Hello from the console!", { type: "info" });
559
+
560
+ // Show a dialog
561
+ await PDS.ask("Are you sure?", { type: "confirm" });
562
+
563
+ // Validate design accessibility
564
+ PDS.validateDesign({
565
+ colors: { primary: '#007acc', background: '#ffffff' }
566
+ }, { minContrast: 4.5 });
567
+
568
+ // List all enhancers
569
+ PDS.defaultEnhancers
570
+
571
+ // Access design system metadata
572
+ PDS.ontology.primitives
573
+ PDS.ontology.layout
574
+ ```
575
+
576
+ ### Listening to Events
577
+
578
+ ```javascript
579
+ // System ready
580
+ PDS.addEventListener('pds:ready', (e) => console.log('Ready!', e.detail));
581
+
582
+ // Theme changed
583
+ PDS.addEventListener('pds:theme:changed', (e) => console.log('Theme:', e.detail.theme));
584
+
585
+ // Design updated (from configurator)
586
+ PDS.addEventListener('pds:design:updated', (e) => console.log('Config:', e.detail.config));
587
+ ```
588
+
589
+ ---
590
+
591
+ ## 8. Resources
592
+
593
+ ### Official Links
594
+
595
+ - 🏠 [**GitHub Repository**](https://github.com/mvneerven/pure-ds)
596
+ - 📦 [**NPM: @pure-ds/core**](https://www.npmjs.com/package/@pure-ds/core)
597
+ - 📖 [**Pure Web Manifesto**](https://pureweb.dev/manifesto)
598
+ - 🎮 [**CodePen Collection**](https://codepen.io/collection/rBjkOy)
599
+
600
+ ### Documentation
601
+
602
+ - Browse the **Foundations** section to understand tokens
603
+ - Check **Primitives** for available CSS classes
604
+ - Explore **Components** for Web Component APIs
605
+ - Review **Enhancements** for progressive upgrade patterns
606
+
607
+ ### Quick Reference
608
+
609
+ | Task | Solution |
610
+ |------|----------|
611
+ | Show a dialog | `await PDS.ask("Message", { type: "confirm" })` |
612
+ | Toast notification | `PDS.toast("Message", { type: "success" })` |
613
+ | Change theme | `PDS.theme = 'dark'` |
614
+ | Query tokens | `await PDS.query("primary color")` |
615
+ | Adopt styles in Shadow DOM | `await PDS.adoptPrimitives(shadowRoot)` |
616
+
617
+ ### Getting Help
618
+
619
+ - Use the **Quick Search** (🔍 icon in toolbar) to ask natural language questions
620
+ - Open the **Configurator** (⚙️ icon) to experiment with design values
621
+ - Check browser DevTools console for PDS logging
622
+ - Explore `PDS.compiled` in live mode for full introspection
623
+
624
+ ---
625
+
626
+ **Happy building with PDS!** Remember: The browser is the framework. Write semantic HTML, let PDS handle the rest.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.4.35",
4
+ "version": "0.4.37",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -44,6 +44,7 @@
44
44
  "files": [
45
45
  ".github/copilot-instructions.md",
46
46
  ".cursorrules",
47
+ "getting-started.md",
47
48
  "dist/types/",
48
49
  "public/assets/js/",
49
50
  "public/assets/pds/components/",
@@ -435,6 +435,16 @@ async function copyPdsAssets() {
435
435
  // Copy Copilot instructions to consumer project
436
436
  await copyCopilotInstructions(consumerRoot);
437
437
 
438
+ // Copy getting started guide
439
+ try {
440
+ const sourceFile = path.join(repoRoot, 'getting-started.md');
441
+ const targetFile = path.join(consumerRoot, 'getting-started.md');
442
+ await copyFile(sourceFile, targetFile);
443
+ console.log('📖 Copied getting-started.md to project root');
444
+ } catch (e) {
445
+ console.warn('⚠️ Could not copy getting-started.md:', e.message);
446
+ }
447
+
438
448
  // Proactively add export & build-icons scripts to consumer package.json (still helpful)
439
449
  await ensureExportScript(consumerRoot);
440
450
  try {
@@ -534,8 +544,8 @@ async function copyPdsAssets() {
534
544
  console.error('⚙️ Configuration file: pds.config.js');
535
545
  console.error('📋 Copilot instructions: .github/copilot-instructions.md');
536
546
  console.error('➤ Cursor instructions: .cursorrules');
537
- console.error('📚 Get your own PDS Storybook via \'npm install @pure-ds/storybook\'');
538
- console.error('📖 See readme.md\n');
547
+ console.error(' Getting started guide: getting-started.md');
548
+ console.error('📚 Get your own PDS Storybook via \'npm install @pure-ds/storybook\'\n');
539
549
  } catch {
540
550
  console.error('📦 Run "npm run pds:export" to generate assets\n');
541
551
  }
package/readme.md CHANGED
@@ -628,11 +628,12 @@ Methods:
628
628
  **`<pds-tabstrip>`** - Accessible tab interface
629
629
  ```html
630
630
  <pds-tabstrip>
631
- <button slot="tab">Overview</button>
632
- <div slot="panel">Overview content</div>
633
-
634
- <button slot="tab">Details</button>
635
- <div slot="panel">Details content</div>
631
+ <pds-tabpanel label="Overview">
632
+ <p>Overview content</p>
633
+ </pds-tabpanel>
634
+ <pds-tabpanel label="Details">
635
+ <p>Details content</p>
636
+ </pds-tabpanel>
636
637
  </pds-tabstrip>
637
638
  ```
638
639
 
@@ -663,14 +664,21 @@ Events:
663
664
 
664
665
  **`<pds-toaster>`** - Toast notifications
665
666
  ```html
666
- <pds-toaster id="toaster"></pds-toaster>
667
-
667
+ <!-- No manual setup needed - PDS.toast() auto-creates the component -->
668
668
  <script>
669
- const toaster = document.getElementById('toaster');
670
- toaster.show({
671
- message: 'Saved successfully!',
672
- type: 'success',
673
- duration: 3000
669
+ // Simple usage
670
+ await PDS.toast('Saved successfully!', { type: 'success' });
671
+
672
+ // With custom duration
673
+ await PDS.toast('Processing...', {
674
+ type: 'information',
675
+ duration: 5000
676
+ });
677
+
678
+ // Persistent (must be manually closed)
679
+ await PDS.toast('Important notice', {
680
+ type: 'warning',
681
+ persistent: true
674
682
  });
675
683
  </script>
676
684
  ```