@rhavenside/baseline 2.0.7 → 2.1.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
@@ -9,6 +9,12 @@ A strict, layer-based design system with semantic tokens. Features a custom nami
9
9
  [![npm version](https://img.shields.io/npm/v/@rhavenside/baseline.svg)](https://www.npmjs.com/package/@rhavenside/baseline)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
11
 
12
+ <div align="center">
13
+
14
+ **[📚 Documentation](https://baseline.rhavenside.de)** • **[🎨 Examples](https://examples.rhavenside.de)**
15
+
16
+ </div>
17
+
12
18
  ## Installation
13
19
 
14
20
  Install Base-Line via npm:
@@ -25,6 +31,8 @@ Or via CDN:
25
31
 
26
32
  ## Quick Start
27
33
 
34
+ Base-Line automatically includes [Cadence](https://www.npmjs.com/package/@rhavenside/cadence) for motion and [Scaffold](https://www.npmjs.com/package/@rhavenside/scaffold) for layouts. No additional setup required!
35
+
28
36
  ### CSS Only
29
37
 
30
38
  Include the CSS file in your HTML:
@@ -39,8 +47,8 @@ Include the CSS file in your HTML:
39
47
  <title>Base-Line Example</title>
40
48
  </head>
41
49
  <body>
42
- <div class="l-container">
43
- <div class="l-stack l-stack--lg">
50
+ <div class="scaffold-container">
51
+ <div class="scaffold-stack scaffold-stack--spacing-lg">
44
52
  <h1>Hello Base-Line</h1>
45
53
  <p>Welcome to the Base-Line Design System</p>
46
54
  <button class="c-button c-button--primary">Get Started</button>
@@ -50,6 +58,8 @@ Include the CSS file in your HTML:
50
58
  </html>
51
59
  ```
52
60
 
61
+ **Note:** The example above uses Scaffold layout classes (`scaffold-container`, `scaffold-stack`) for structured layouts. All components use Cadence motion mixins automatically for smooth, consistent animations.
62
+
53
63
  ### With JavaScript
54
64
 
55
65
  For interactive components (modals, dropdowns, tooltips, etc.), include the JavaScript:
@@ -119,7 +129,7 @@ All design values are defined via CSS Custom Properties:
119
129
 
120
130
  - **Colors**: Surface, Text, Accent, Border, State colors
121
131
  - **Typography**: Font families, sizes, line-height, weight
122
- - **Spacing**: Consistent step scale (4px base)
132
+ - **Spacing**: Consistent step scale (based on Scaffold spacing: 8px/0.5rem base)
123
133
  - **Radius**: Border-radius values
124
134
  - **Shadow**: Shadow definitions
125
135
  - **Z-Index**: Z-index scale
@@ -129,15 +139,114 @@ All design values are defined via CSS Custom Properties:
129
139
 
130
140
  ### Layer 2: Layout System
131
141
 
132
- Layout classes for standard layouts without custom CSS:
142
+ Layout classes for standard layouts without custom CSS (powered by [Scaffold](https://www.npmjs.com/package/@rhavenside/scaffold)):
133
143
 
134
- - `l-container` - Container with max-width + responsive padding
135
- - `l-stack` - Vertical layouts
136
- - `l-cluster` - Horizontal groups
137
- - `l-grid` - Flexible grid layouts (auto-fit / auto-fill)
144
+ - `scaffold-container` - Container with max-width + responsive padding
145
+ - `scaffold-stack` - Vertical layouts with spacing options
146
+ - `scaffold-grid` - Flexible grid layouts (responsive columns)
147
+ - `scaffold-padding-*` - Padding utilities (xs, sm, md, lg, xl, xxl) with directional variants
148
+ - `scaffold-margin-*` - Margin utilities (xs, sm, md, lg, xl, xxl) with directional variants
138
149
 
139
150
  **Rule:** No colors, no typography in layout classes.
140
151
 
152
+ **Example:**
153
+ ```html
154
+ <div class="scaffold-container">
155
+ <div class="scaffold-stack scaffold-stack--spacing-lg">
156
+ <h1>Title</h1>
157
+ <p>Content</p>
158
+ </div>
159
+ <div class="scaffold-grid scaffold-grid--cols-3">
160
+ <div class="c-card">Card 1</div>
161
+ <div class="c-card">Card 2</div>
162
+ <div class="c-card">Card 3</div>
163
+ </div>
164
+ </div>
165
+ ```
166
+
167
+ ### Motion System (Cadence)
168
+
169
+ All animations and transitions use [Cadence](https://www.npmjs.com/package/@rhavenside/cadence) for consistent motion timing:
170
+
171
+ - **motion-response()** - For direct user interactions (150ms) - Used in buttons, inputs, form controls
172
+ - **motion-transition()** - For state changes (300ms) - Used in modals, dropdowns, tooltips, alerts
173
+ - **motion-ambient()** - For continuous animations (varies) - Used in spinners, progress bars
174
+ - **motion-instant()** - For immediate changes (0ms) - Used for instant state updates
175
+
176
+ All components automatically use the appropriate motion intention based on their interaction pattern. This ensures consistent, accessible animations throughout your application.
177
+
178
+ ## How Cadence, Scaffold, and Baseline Work Together
179
+
180
+ Base-Line is built on three complementary systems that work seamlessly together:
181
+
182
+ ### Baseline - The Design System
183
+
184
+ **Baseline** provides the core design system:
185
+ - **Components**: Buttons, Cards, Modals, Forms, and 20+ other UI components
186
+ - **Design Tokens**: Colors, typography, spacing, shadows, and other design values
187
+ - **Utilities**: Limited utility classes for common needs
188
+
189
+ ### Scaffold - The Layout System
190
+
191
+ **Scaffold** provides structured layout classes:
192
+ - **Container**: `scaffold-container` for max-width containers with responsive padding
193
+ - **Stack**: `scaffold-stack` for vertical layouts with consistent spacing
194
+ - **Grid**: `scaffold-grid` for flexible, responsive grid layouts
195
+ - **Padding**: Responsive padding utilities
196
+
197
+ Scaffold handles the **structure** of your page - where things are positioned and how they're spaced.
198
+
199
+ > **Note:** Scaffold can also be used independently. See [@rhavenside/scaffold](https://www.npmjs.com/package/@rhavenside/scaffold) for standalone usage.
200
+
201
+ ### Cadence - The Motion System
202
+
203
+ **Cadence** provides consistent motion and animations:
204
+ - **Motion Intentions**: Different timing for different interaction types
205
+ - `motion-response()` - Fast feedback for direct user actions (150ms)
206
+ - `motion-transition()` - Smooth state changes (300ms)
207
+ - `motion-ambient()` - Continuous animations (varies)
208
+ - **Automatic Integration**: All Baseline components automatically use Cadence for animations
209
+
210
+ Cadence handles the **motion** - how things animate and transition.
211
+
212
+ > **Note:** Cadence can also be used independently. See [@rhavenside/cadence](https://www.npmjs.com/package/@rhavenside/cadence) for standalone usage.
213
+
214
+ ### Working Together
215
+
216
+ Here's how they work together in practice:
217
+
218
+ ```html
219
+ <!-- Scaffold provides the layout structure -->
220
+ <div class="scaffold-container">
221
+ <div class="scaffold-stack scaffold-stack--spacing-lg">
222
+
223
+ <!-- Baseline provides the components -->
224
+ <h1>Welcome</h1>
225
+ <button class="c-button c-button--primary">Get Started</button>
226
+
227
+ <!-- Cadence automatically animates the button on hover/click -->
228
+ <!-- Scaffold provides spacing between elements -->
229
+ <div class="scaffold-grid scaffold-grid--cols-3">
230
+ <div class="c-card">
231
+ <!-- Cadence animates card hover states -->
232
+ Card 1
233
+ </div>
234
+ <div class="c-card">Card 2</div>
235
+ <div class="c-card">Card 3</div>
236
+ </div>
237
+ </div>
238
+ </div>
239
+ ```
240
+
241
+ **In summary:**
242
+ - **Scaffold** = Where things go (layout structure)
243
+ - **Baseline** = What things look like (components and design)
244
+ - **Cadence** = How things move (animations and transitions)
245
+
246
+ All three are included automatically when you install `@rhavenside/baseline` - no additional setup required!
247
+
248
+ > **Note:** This is a high-level overview. Detailed documentation for each system is available in the [full documentation](https://baseline.rhavenside.de).
249
+
141
250
  ### Layer 3: Components
142
251
 
143
252
  Fully functional components with JavaScript support:
@@ -198,13 +307,14 @@ Format: `--<category>-<meaning>[-<level>]`
198
307
 
199
308
  ### Layout Classes
200
309
 
201
- Format: `l-<role>`
310
+ Format: `scaffold-<role>` (powered by [Scaffold](https://www.npmjs.com/package/@rhavenside/scaffold))
202
311
 
203
312
  ```html
204
- <div class="l-container">
205
- <div class="l-stack l-stack--lg">
206
- <div class="l-cluster l-cluster--center">
207
- <div class="l-grid l-grid--auto-fit">
313
+ <div class="scaffold-container">
314
+ <div class="scaffold-stack scaffold-stack--spacing-lg">
315
+ <div class="scaffold-stack scaffold-stack--horizontal scaffold-stack--align-center">
316
+ <div class="scaffold-grid scaffold-grid--cols-3">
317
+ <div class="scaffold-padding-sm scaffold-margin-top-md">
208
318
  ```
209
319
 
210
320
  ### Components
@@ -222,7 +332,7 @@ Format: `c-<component>`
222
332
  - `c-alert--danger`, `c-alert--success`
223
333
 
224
334
  **Global States:**
225
- - `is-hovered`, `is-active`, `is-disabled`
335
+ - `is-active`, `is-disabled`, `is-show` (for collapse/accordion)
226
336
  - `is-loading`, `is-open`, `has-error`
227
337
 
228
338
  ### Utilities
@@ -394,19 +504,68 @@ const tooltip = window.BaseLine.Tooltip.getOrCreateInstance(element)
394
504
  ### Form
395
505
 
396
506
  ```html
397
- <div class="l-stack l-stack--sm">
398
- <label class="c-form-label" for="email">Email</label>
399
- <input type="email" class="c-form-control" id="email" placeholder="name@example.com">
400
- </div>
507
+ <div class="scaffold-container scaffold-container--narrow">
508
+ <div class="scaffold-stack scaffold-stack--spacing-md">
509
+ <div class="scaffold-stack scaffold-stack--spacing-sm">
510
+ <label class="c-form-label" for="email">Email</label>
511
+ <input type="email" class="c-form-control" id="email" placeholder="name@example.com">
512
+ </div>
513
+
514
+ <div class="scaffold-stack scaffold-stack--spacing-sm">
515
+ <label class="c-form-label" for="password">Password</label>
516
+ <input type="password" class="c-form-control" id="password">
517
+ </div>
401
518
 
402
- <div class="l-stack l-stack--sm">
403
- <label class="c-form-label" for="password">Password</label>
404
- <input type="password" class="c-form-control" id="password">
519
+ <button type="submit" class="c-button c-button--primary">Submit</button>
520
+ </div>
405
521
  </div>
522
+ ```
523
+
524
+ **Note:** This example demonstrates Scaffold layout classes for structured form layouts. All form inputs automatically use Cadence motion-response() for smooth focus and interaction transitions.
525
+
526
+ ### Accordion
406
527
 
407
- <button type="submit" class="c-button c-button--primary">Submit</button>
528
+ ```html
529
+ <div class="c-accordion" id="accordionExample">
530
+ <div class="c-accordion-item">
531
+ <h2 class="c-accordion-header">
532
+ <button
533
+ class="c-accordion-button"
534
+ type="button"
535
+ data-c-toggle="collapse"
536
+ data-c-target="#collapseOne"
537
+ data-c-parent="#accordionExample">
538
+ Accordion Item #1
539
+ </button>
540
+ </h2>
541
+ <div id="collapseOne" class="c-collapse is-show" data-c-parent="#accordionExample">
542
+ <div class="c-accordion-body">
543
+ This is the first accordion body. It is open by default (has `is-show` class).
544
+ </div>
545
+ </div>
546
+ </div>
547
+ <div class="c-accordion-item">
548
+ <h2 class="c-accordion-header">
549
+ <button
550
+ class="c-accordion-button c-collapsed"
551
+ type="button"
552
+ data-c-toggle="collapse"
553
+ data-c-target="#collapseTwo"
554
+ data-c-parent="#accordionExample">
555
+ Accordion Item #2
556
+ </button>
557
+ </h2>
558
+ <div id="collapseTwo" class="c-collapse" data-c-parent="#accordionExample">
559
+ <div class="c-accordion-body">
560
+ This is the second accordion body. It is closed by default (no `is-show` class, button has `c-collapsed`).
561
+ </div>
562
+ </div>
563
+ </div>
564
+ </div>
408
565
  ```
409
566
 
567
+ **Note:** By default, only the first accordion item should be open (with `is-show` class on the collapse element). Other items should be closed (no `is-show` class, button has `c-collapsed` class). Accordions use Cadence motion-transition() for smooth expand/collapse animations.
568
+
410
569
  ## Dark Mode
411
570
 
412
571
  Dark mode is automatically activated via `prefers-color-scheme`. Additionally, the `.theme-dark` class can be set manually:
@@ -455,7 +614,72 @@ Base-Line supports all modern browsers:
455
614
 
456
615
  ## Dependencies
457
616
 
458
- - **@popperjs/core**: ^2.11.8 (for positioning tooltips, popovers, dropdowns)
617
+ Base-Line includes the following peer dependencies that are automatically installed:
618
+
619
+ - **@rhavenside/cadence**: ^1.0.1 - Motion system for consistent animations and transitions
620
+ - **@rhavenside/scaffold**: ^1.1.7 - Layout system for structured page layouts
621
+ - **@popperjs/core**: ^2.11.8 - For positioning tooltips, popovers, and dropdowns
622
+
623
+ All dependencies are automatically installed when you install `@rhavenside/baseline`. No additional setup required!
624
+
625
+ ## Version History
626
+
627
+ ### Version 2.1.0 and above
628
+
629
+ **New Dependencies: Scaffold and Cadence Integration**
630
+
631
+ Version 2.1.0 introduces two new integrated systems:
632
+
633
+ **Scaffold Layout System (NEW)**
634
+
635
+ - **Scaffold is now included**: Scaffold layout classes are now part of Base-Line
636
+ - **Layout Classes Available**: Use `scaffold-container`, `scaffold-stack`, `scaffold-grid` for structured page layouts
637
+ - **Responsive by Default**: All Scaffold classes are responsive and work seamlessly with Baseline components
638
+
639
+ **Cadence Motion System Integration**
640
+
641
+ All interactive components now use the Cadence motion system for consistent, accessible animations:
642
+
643
+ - **Motion-Mixins in Components**: 10 components have been updated to use Cadence motion mixins:
644
+ - `motion-transition()` for state changes (Alert, Toast, Tooltip, Popover, Dropdown, Accordion, Floating Label)
645
+ - `motion-response()` for direct user interactions (Form Range, List Group)
646
+ - **Consistent Animation Timing**: All components now follow the same motion principles:
647
+ - 150ms for direct user interactions (`motion-response`)
648
+ - 300ms for state changes (`motion-transition`)
649
+ - **Improved Documentation**: README now includes comprehensive documentation for:
650
+ - Cadence motion system integration
651
+ - Scaffold layout system usage
652
+ - Dependencies and their purposes
653
+
654
+ **Benefits:**
655
+ - Structured layout system (Scaffold) for consistent page layouts
656
+ - More consistent animations across all components (Cadence)
657
+ - Better accessibility (respects `prefers-reduced-motion`)
658
+ - Easier to maintain and extend motion behavior
659
+ - Clear motion intentions for different interaction types
660
+
661
+ ### Version 2.0.8 and below
662
+
663
+ **Before 2.1.0:**
664
+
665
+ - **No Scaffold**: Layout classes were not available - developers had to create their own layout solutions
666
+ - **No unified motion system**: Components used hardcoded transition values or CSS variables for animations
667
+ - **Manual transition timing**: Manual transition timing management required
668
+ - **Less consistent**: Less consistent animation behavior across components
669
+
670
+ **Migration Notes:**
671
+
672
+ If you're upgrading from 2.0.8 or earlier:
673
+
674
+ - **No breaking changes**: All existing code will continue to work without modifications
675
+ - **Scaffold is NEW**: Scaffold layout classes (`scaffold-container`, `scaffold-stack`, `scaffold-grid`, etc.) are now available in Base-Line 2.1.0. You can start using them for structured page layouts
676
+ - **Motion improvements are internal**: The Cadence motion mixins are internal improvements that make animations more consistent. Existing component behavior remains the same
677
+ - **New features available**: You can now take advantage of:
678
+ - Scaffold layout system for structured page layouts
679
+ - More consistent animations (automatic, no code changes needed)
680
+ - Better motion system documentation
681
+
682
+ If you were using custom transitions that override component defaults, you may want to review them to ensure they align with the new motion system principles (150ms for interactions, 300ms for state changes).
459
683
 
460
684
  ## License
461
685