Table of Contents
- Preface
- Who This Book Is For
- What You Need
- How This Book Is Organized
- How We Build Each Component
- Conventions Used in This Book
- Using Code Examples
- Getting Started: Tokens and the Package Template
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Token Files
- Step 2: Themes
- Step 3: The Component Template
- Step 4: Tooling
- Step 5: The First Test
- Step 6: Enforcing the Token Rules
- Seeing the Component Run
- Styling API
- Accessibility
- Pitfalls
- Summary
- Exercises
- Part I: Compound Components
- Chapter 1. Tabs
- What We Are Building, and Why
- Technical Requirements
- The Pattern You Are Implementing
- Concepts You Need Before Writing Code
- Designing the Markup
- Step 1: The Tab
- Step 2: The Panel
- Step 3: The Parent and Its Slots
- Step 4: One Function That Makes Everything Agree
- Step 5: Roving Tabindex
- Step 6: The Keyboard
- Step 7: A Cancelable Event
- Step 8: The Sliding Indicator
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 2. Dialog, Popover, and Tooltip
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Positioning Math
- Step 2: The Position Controller
- Step 3: The Dialog
- Step 4: The Popover
- Step 5: The Tooltip
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 1. Tabs
- Part II: Forms and Input
- Chapter 3. Form-Associated Inputs
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Form Control Mixin
- Step 2: Wrapping a Native Input
- Step 3: The Select and the Slider
- Step 4: Building from Scratch, the Rating
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 4. Combobox
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Structure
- Step 2: Loading Options with a Task
- Step 3: Keyboard and Selection
- Step 4: Taking Part in a Form
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 5. Date Range Picker
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: Date Utilities
- Step 2: The Range State Machine
- Step 3: The Calendar
- Step 4: The Keyboard
- Step 5: Choosing a Day
- Step 6: The Picker
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 3. Form-Associated Inputs
- Part III: Data and Hierarchy
- Chapter 6. Data Table
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Data Pipeline
- Step 2: The Table
- Step 3: Sharing State with Context
- Step 4: Selection
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 7. Tree View
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Pure Model
- Step 2: Rendering the Tree
- Step 3: Focus, Clicks and the Keyboard
- Step 4: Selection
- Step 5: Lazy Loading
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 6. Data Table
- Part IV: Motion, Flow and Pointer Input
- Chapter 8. Carousel
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: Describing the Slides
- Step 2: Scroll Snap Layout
- Step 3: Knowing Which Slide Is Current
- Step 4: Moving
- Step 5: Keyboard and Announcements
- Step 6: Autoplay
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 9. Stepper
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: The Navigation Rules
- Step 2: Collecting and Restoring Values
- Step 3: The Steps
- Step 4: The Stepper's State
- Step 5: Navigation
- Step 6: Branching in Practice
- Step 7: The Progress List
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 10. Image Cropper
- What We Are Building, and Why
- Technical Requirements
- Concepts You Need Before Writing Code
- Step 1: Moving and Resizing a Rectangle
- Step 2: Orientation
- Step 3: The View, Zoom and Pan
- Step 4: Drawing
- Step 5: Dragging
- Step 6: Keyboard and Numbers
- Step 7: Exporting
- Seeing the Component Run
- Styling API
- Accessibility
- Testing
- Pitfalls
- Summary
- Exercises
- Chapter 8. Carousel
- Appendices
- Appendix A. Token Naming and Publishing
- A.1 The Naming Grammar
- A.2 The Package
- A.3 Enforcement
- A.4 Changing and Retiring Tokens
- A.5 Generating Tokens from a Design Tool
- Appendix B. Packaging for npm
- B.1 Building
- B.2 What Ships
- B.3 Dependencies
- B.4 Describing the Components
- B.5 Versioning and Release
- Appendix C. Using the Components in Frameworks
- C.1 The Four Interfaces of a Component
- C.2 Attributes or Properties
- C.3 Events
- C.4 Slots and Children
- C.5 Forms
- C.6 Server-Side Rendering
- C.7 A Checklist for Integration
- Appendix D. Accessibility Testing Checklist
- D.1 What Was Tested
- D.2 What Automated Tests Cannot Check
- D.3 A Manual Test Script for Each Component
- D.4 Per-Component Notes
- D.5 Making It Routine
- Appendix E. Exercise Solutions
- E.1 How the Solutions Are Built and Run
- E.2 Getting Started: Tokens and the Package Template
- E.3 Chapter 1 Solutions: Tabs
- E.4 Chapter 2 Solutions: Dialogs, Popovers and Tooltips
- E.5 Chapter 3 Solutions: Form Inputs
- E.6 Chapter 4 Solutions: Combobox
- E.7 Chapter 5 Solutions: Date Range Picker
- E.8 Chapter 6 Solutions: Data Table
- E.9 Chapter 7 Solutions: Tree View
- E.10 Chapter 8 Solutions: Carousel
- E.11 Chapter 9 Solutions: Stepper
- E.12 Chapter 10 Solutions: Image Cropper
- E.13 What the Exercises Found
- Appendix F. Further Reading
- F.1 Lit and Web Components
- F.2 Accessibility Patterns
- F.3 Platform References
- F.4 Testing and Tooling
- Appendix A. Token Naming and Publishing
- Glossary
- Index
- About the Author
